yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #54084
[Bug 1603236] Re: py35: TestCheckForMutableDefaultArgs fails
Reviewed: https://review.openstack.org/337952
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=05b5dfe144958b70331a84118440d6bb0e2863e2
Submitter: Jenkins
Branch: master
commit 05b5dfe144958b70331a84118440d6bb0e2863e2
Author: Eric Brown <browne@xxxxxxxxxx>
Date: Tue Jul 5 18:53:52 2016 -0700
Handle Py35 fix of ast.node.col_offset bug
In 3.5, the ast module returns the correct value for the col_offset
of a function definition whereas earlier versions did not. The value
is off by one column.
Closes-Bug: #1603236
Change-Id: I7835d7ed8d652a6bd585e8e0372fab402424038d
** Changed in: keystone
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Identity (keystone).
https://bugs.launchpad.net/bugs/1603236
Title:
py35: TestCheckForMutableDefaultArgs fails
Status in OpenStack Identity (keystone):
Fix Released
Bug description:
The py35 gate fails on TestCheckForMutableDefaultArgs.
http://logs.openstack.org/52/337952/7/check/gate-keystone-python35-db-nv/2e9682b/testr_results.html.gz
ft125.1: keystone.tests.unit.test_hacking_checks.TestCheckForMutableDefaultArgs.test_StringException: Traceback (most recent call last):
File "/home/jenkins/workspace/gate-keystone-python35-db-nv/keystone/tests/unit/test_hacking_checks.py", line 64, in test
self.assert_has_errors(code, expected_errors=errors)
File "/home/jenkins/workspace/gate-keystone-python35-db-nv/keystone/tests/unit/test_hacking_checks.py", line 53, in assert_has_errors
self.assertItemsEqual(expected_errors or [], actual_errors)
File "/home/jenkins/workspace/gate-keystone-python35-db-nv/.tox/py35/lib/python3.5/site-packages/unittest2/case.py", line 1182, in assertItemsEqual
return self.assertSequenceEqual(expected, actual, msg=msg)
File "/home/jenkins/workspace/gate-keystone-python35-db-nv/.tox/py35/lib/python3.5/site-packages/unittest2/case.py", line 1014, in assertSequenceEqual
self.fail(msg)
File "/home/jenkins/workspace/gate-keystone-python35-db-nv/.tox/py35/lib/python3.5/site-packages/unittest2/case.py", line 690, in fail
raise self.failureException(msg)
AssertionError: Sequences differ: [(7, [201 chars] 'K001'), (28, 27, 'K001'), (29, 21, 'K001'), (32, 11, 'K001')] != [(7, [201 chars] 'K001'), (28, 26, 'K001'), (29, 21, 'K001'), (32, 10, 'K001')]
First differing element 12:
(28, 27, 'K001')
(28, 26, 'K001')
[(7, 10, 'K001'),
(10, 15, 'K001'),
(10, 29, 'K001'),
(13, 15, 'K001'),
(16, 15, 'K001'),
(16, 31, 'K001'),
(22, 14, 'K001'),
(22, 31, 'K001'),
(22, 53, 'K001'),
(25, 14, 'K001'),
(25, 36, 'K001'),
(28, 10, 'K001'),
- (28, 27, 'K001'),
? ^
+ (28, 26, 'K001'),
? ^
(29, 21, 'K001'),
- (32, 11, 'K001')]
? ^
+ (32, 10, 'K001')]
? ^
The root cause is a difference the in the ast node col_offset value.
Python 3.4 and earlier were incorrect whereas 3.5 is fixed. It only
affected two of the function definitions in the code sample.
Here is a sample piece of code that illustrates the difference in the
ast module between Pythong 3.5 and earlier versions:
http://paste.openstack.org/show/532929/
To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1603236/+subscriptions
References