Message6434
Hi Tom:
Thanks for the test case. I had to make a change to get it to work
under python2. The code now reads:
...
expected_names = ['context', 'user_realnames', 'x']
got_names = pe._f_varnames
try:
self.assertItemsEqual(expected_names, got_names)
except AttributeError:
self.assertCountEqual(expected_names, got_names)
however I expected this to pass when run as:
python2 ./run_tests.py test/test_pythonexpr.py
without any patches to the roundup code since this problem doesn't
happen under python2. But it fails with:
... try:
> self.assertItemsEqual(expected_names, got_names)
E AssertionError: Element counts were not equal:
E First has 1, Second has 0: 'x'
E First has 0, Second has 1: 'assignedto'
E First has 0, Second has 1: 'realname'
It also fails under python 3 with:
self.assertItemsEqual(expected_names, got_names)
except AttributeError:
> self.assertCountEqual(expected_names, got_names)
E AssertionError: Element counts were not equal:
E First has 1, Second has 0: 'user_realnames'
E First has 1, Second has 0: 'x'
E First has 0, Second has 1: 'assignedto'
Does the indicate we have had issues under python2 and just never
noticed?
With your patch to PythonExpr.py both test cases pass.
If you can shed a little light on the unexpected python 2 failure
without the patch I would appreciate it.
-- rouilj |
|
Date |
User |
Action |
Args |
2019-03-25 23:28:50 | rouilj | set | messageid: <1553556530.69.0.781152587943.issue2551026@roundup.psfhosted.org> |
2019-03-25 23:28:50 | rouilj | set | recipients:
+ rouilj, joseph_myers, tekberg |
2019-03-25 23:28:50 | rouilj | link | issue2551026 messages |
2019-03-25 23:28:50 | rouilj | create | |
|