summaryrefslogtreecommitdiff
path: root/tests/run.py
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2009-09-15 12:23:33 +0200
committergbrandl <devnull@localhost>2009-09-15 12:23:33 +0200
commitf5b5259de94b1c52e2c1212fb3bf7e91ec7bedb5 (patch)
tree5ce0b1cf478b95a61b335fdd8a6a12f9aa422251 /tests/run.py
parent2cdd7e197d4d69b85e2f1bba4a4da612f06a63b6 (diff)
downloadpygments-f5b5259de94b1c52e2c1212fb3bf7e91ec7bedb5.tar.gz
Fix Python 3 compatibility of test runner.
Diffstat (limited to 'tests/run.py')
-rw-r--r--tests/run.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/run.py b/tests/run.py
index 8652042d..bb5d6f24 100644
--- a/tests/run.py
+++ b/tests/run.py
@@ -21,7 +21,9 @@ if sys.version_info >= (3,):
testroot = os.path.dirname(__file__)
newroot = os.path.join(testroot, '..', 'build/lib/test')
copydir_run_2to3(testroot, newroot)
- os.chdir(os.path.join(newroot, '..'))
+ # make nose believe that we run from the converted dir
+ os.chdir(newroot)
+ __file__ = os.path.join('run.py')
try:
import nose
@@ -33,8 +35,8 @@ try:
# make sure the current source is first on sys.path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import pygments
-except ImportError, err:
- print ('Cannot find Pygments to test: %s' % err)
+except ImportError:
+ print ('Cannot find Pygments to test: %s' % sys.exc_info()[1])
sys.exit(1)
else:
print ('Pygments %s test suite running (Python %s)...' %