[issue9315] The trace module lacks unit tests
Eli Bendersky
report at bugs.python.org
Mon Aug 2 04:43:16 CEST 2010
Eli Bendersky <eliben at gmail.com> added the comment:
The single test-runner in regrtest.py (runtest_inner) uses the standard import machinery (__import__) to load tests. Thus, is the test has been loaded recently (**) it is reloaded from its .pyc file. In such a case, its module __file__ var points to the .pyc file name, while __code__.co_filename points to the .py file name (and the latter is what trace.py uses). This creates a discrepancy in the results that should be probably handled by ignoring the extension in comparisons.
(**) Some testing shows a strange temporal behavior. If I wait a few minutes, `py27 regrtest.py test_trace` runs again. Maybe this has to do with compiled .pyc files being stored somewhere in /temp which gets cleaned up.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9315>
_______________________________________
More information about the Python-bugs-list
mailing list