diff --git a/run_tests b/run_tests index d7144b3c..a09ab382 100755 --- a/run_tests +++ b/run_tests @@ -42,9 +42,11 @@ def main(argv): """The main entry.""" # Add the repo tree to PYTHONPATH as the tests expect to be able to import # modules directly. - topdir = os.path.dirname(os.path.realpath(__file__)) - pythonpath = os.environ.get('PYTHONPATH', '') - os.environ['PYTHONPATH'] = '%s:%s' % (topdir, pythonpath) + pythonpath = os.path.dirname(os.path.realpath(__file__)) + oldpythonpath = os.environ.get('PYTHONPATH', None) + if oldpythonpath is not None: + pythonpath += os.pathsep + oldpythonpath + os.environ['PYTHONPATH'] = pythonpath return run_pytest('pytest', argv) diff --git a/tox.ini b/tox.ini index bd1e18cc..1a9642a3 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,11 @@ envlist = py27, py36, py37, py38 [testenv] deps = pytest -commands = {toxinidir}/run_tests +commands = {envpython} run_tests +setenv = + GIT_AUTHOR_NAME = Repo test author + GIT_COMMITTER_NAME = Repo test committer + EMAIL = repo@gerrit.nodomain [testenv:py27] deps =