diff options
author | gbrandl <devnull@localhost> | 2009-09-15 12:31:36 +0200 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2009-09-15 12:31:36 +0200 |
commit | 36954be37ea3366e907d0606ae0849520372eb9b (patch) | |
tree | efa175f14da8ba5add4adafc54e9bc60fd18b307 | |
parent | 4e769457b27abdc2cfee2c795b1bb44486d66840 (diff) | |
download | pygments-36954be37ea3366e907d0606ae0849520372eb9b.tar.gz |
Fix test running for running from src dir.
-rw-r--r-- | tests/run.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/run.py b/tests/run.py index bb5d6f24..97c832d2 100644 --- a/tests/run.py +++ b/tests/run.py @@ -23,7 +23,10 @@ if sys.version_info >= (3,): copydir_run_2to3(testroot, newroot) # make nose believe that we run from the converted dir os.chdir(newroot) - __file__ = os.path.join('run.py') +else: + # only find tests in this directory + os.chdir(os.path.dirname(__file__)) + try: import nose @@ -33,7 +36,7 @@ except ImportError: try: # make sure the current source is first on sys.path - sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) + sys.path.insert(0, '..') import pygments except ImportError: print ('Cannot find Pygments to test: %s' % sys.exc_info()[1]) |