diff options
-rwxr-xr-x | run_tests | 8 | ||||
-rw-r--r-- | tox.ini | 6 |
2 files changed, 10 insertions, 4 deletions
@@ -42,9 +42,11 @@ def main(argv): | |||
42 | """The main entry.""" | 42 | """The main entry.""" |
43 | # Add the repo tree to PYTHONPATH as the tests expect to be able to import | 43 | # Add the repo tree to PYTHONPATH as the tests expect to be able to import |
44 | # modules directly. | 44 | # modules directly. |
45 | topdir = os.path.dirname(os.path.realpath(__file__)) | 45 | pythonpath = os.path.dirname(os.path.realpath(__file__)) |
46 | pythonpath = os.environ.get('PYTHONPATH', '') | 46 | oldpythonpath = os.environ.get('PYTHONPATH', None) |
47 | os.environ['PYTHONPATH'] = '%s:%s' % (topdir, pythonpath) | 47 | if oldpythonpath is not None: |
48 | pythonpath += os.pathsep + oldpythonpath | ||
49 | os.environ['PYTHONPATH'] = pythonpath | ||
48 | 50 | ||
49 | return run_pytest('pytest', argv) | 51 | return run_pytest('pytest', argv) |
50 | 52 | ||
@@ -19,7 +19,11 @@ envlist = py27, py36, py37, py38 | |||
19 | 19 | ||
20 | [testenv] | 20 | [testenv] |
21 | deps = pytest | 21 | deps = pytest |
22 | commands = {toxinidir}/run_tests | 22 | commands = {envpython} run_tests |
23 | setenv = | ||
24 | GIT_AUTHOR_NAME = Repo test author | ||
25 | GIT_COMMITTER_NAME = Repo test committer | ||
26 | EMAIL = repo@gerrit.nodomain | ||
23 | 27 | ||
24 | [testenv:py27] | 28 | [testenv:py27] |
25 | deps = | 29 | deps = |