Commits

Anonymous committed d3787c0

Fixing path separator handling in test_all_fixers.py to work on Windows as well as Linux.

Comments (0)

Files changed (1)

test_all_fixers.py

 import importlib
 import lib3to2.tests.support as support
 
-tests_directory = 'lib3to2/tests'  # Relative path to test directory.
+tests_package = 'lib3to2.tests'
 
 if __name__ == "__main__":
-    for module in os.listdir(tests_directory):
+    for module in os.listdir(tests_package.replace('.', os.sep)):
         if module.endswith('.py') and module.startswith('test_'):
-            module = os.path.join(tests_directory, module[:-3])
-            module = module.replace(os.sep, '.')
+            module = tests_package + '.' + module[:-3]
             _module = importlib.import_module(module)
             support.run_all_tests(_module)