Tests: please add path to sys.path (to support running through -m)

Issue #34 resolved
Michał Górny
created an issue

Not a killer feature but would make the Gentoo ebuild a few bytes shorter ;).

$ python -m lib3to2.tests.test_all_fixers
Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib64/python2.7/site-packages/lib3to2/tests/test_all_fixers.py", line 23, in <module>
    _module = __import__(module)
ImportError: No module named test_except

Since the test works on __file__ anyway, I'd guess adding that path to sys.path should not be a problem (or doing an import relative to it).

Comments (2)

  1. Log in to comment