[Python-checkins] r54517 - sandbox/trunk/2to3/tests/support.py sandbox/trunk/2to3/tests/test_fixers.py sandbox/trunk/2to3/tests/test_grammar.py sandbox/trunk/2to3/tests/test_pytree.py
collin.winter
python-checkins at python.org
Thu Mar 22 00:09:48 CET 2007
Author: collin.winter
Date: Thu Mar 22 00:09:43 2007
New Revision: 54517
Modified:
sandbox/trunk/2to3/tests/support.py
sandbox/trunk/2to3/tests/test_fixers.py
sandbox/trunk/2to3/tests/test_grammar.py
sandbox/trunk/2to3/tests/test_pytree.py
Log:
Consolidate testing boilerplate.
Modified: sandbox/trunk/2to3/tests/support.py
==============================================================================
--- sandbox/trunk/2to3/tests/support.py (original)
+++ sandbox/trunk/2to3/tests/support.py Thu Mar 22 00:09:43 2007
@@ -20,10 +20,7 @@
tests = unittest.TestLoader().loadTestsFromModule(test_mod)
unittest.TextTestRunner(verbosity=2).run(tests)
-
-def adjust_path():
- parent_dir = os.path.split(sys.path[0])[0]
- sys.path = [parent_dir] + sys.path
-
def reformat(string):
return dedent(string) + "\n\n"
+
+sys.path.insert(0, os.path.dirname(__file__))
Modified: sandbox/trunk/2to3/tests/test_fixers.py
==============================================================================
--- sandbox/trunk/2to3/tests/test_fixers.py (original)
+++ sandbox/trunk/2to3/tests/test_fixers.py Thu Mar 22 00:09:43 2007
@@ -4,8 +4,6 @@
# Testing imports
import support
-if __name__ == '__main__':
- support.adjust_path()
# Python imports
from StringIO import StringIO
Modified: sandbox/trunk/2to3/tests/test_grammar.py
==============================================================================
--- sandbox/trunk/2to3/tests/test_grammar.py (original)
+++ sandbox/trunk/2to3/tests/test_grammar.py Thu Mar 22 00:09:43 2007
@@ -10,8 +10,6 @@
# Testing imports
import support
-if __name__ == '__main__':
- support.adjust_path()
# Python imports
import os.path
Modified: sandbox/trunk/2to3/tests/test_pytree.py
==============================================================================
--- sandbox/trunk/2to3/tests/test_pytree.py (original)
+++ sandbox/trunk/2to3/tests/test_pytree.py Thu Mar 22 00:09:43 2007
@@ -12,8 +12,6 @@
# Testing imports
import support
-if __name__ == '__main__':
- support.adjust_path()
# Local imports (XXX should become a package)
import pytree
More information about the Python-checkins
mailing list