Message6429
At John's request I wrote a test case. With the non-working version
running the test generates this output:
~/src/tracker-new/roundup-code$ python run_tests.py test/test_pythonexpr.py
====================================== test session starts
=======================================
platform linux -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: /home/tekberg/src/tracker-new/roundup-code, inifile:
collected 1 items
test/test_pythonexpr.py F
============================================ FAILURES
============================================
_______________________________________ ExprTest.testExpr
________________________________________
self = <test.test_pythonexpr.ExprTest testMethod=testExpr>
def testExpr(self):
expr = '[x for x in context.assignedto if x.realname not in
user_realnames]'
pe = PythonExprClass('test', expr, None)
expected_names = ['context', 'user_realnames', 'x']
got_names = pe._f_varnames
> 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'
test/test_pythonexpr.py:25: AssertionError
==================================== 1 failed in 0.07 seconds
====================================
With the fix, running the test generates this output:
~/src/tracker-new/roundup-code$ python run_tests.py test/test_pythonexpr.py
====================================== test session starts
=======================================
platform linux -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: /home/tekberg/src/tracker-new/roundup-code, inifile:
collected 1 items
test/test_pythonexpr.py .
==================================== 1 passed in 0.04 seconds
====================================
I ran pychecker on the changes and the test case. No errors were generated. |
|
Date |
User |
Action |
Args |
2019-03-25 17:28:01 | tekberg | set | messageid: <1553534881.38.0.84428996397.issue2551026@roundup.psfhosted.org> |
2019-03-25 17:28:01 | tekberg | set | recipients:
+ tekberg, rouilj, joseph_myers |
2019-03-25 17:28:01 | tekberg | link | issue2551026 messages |
2019-03-25 17:28:01 | tekberg | create | |
|