summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2020-02-15 13:44:56 -0500
committerMike Frysinger <vapier@google.com>2020-02-15 23:25:25 +0000
commitd21638424cc92d8fa00e7f440300c92d8532f5a8 (patch)
tree5f768b45b58d0bed1cbd05c895bd524213bc106d
parentc102fd5c0d34f39d1111f1a3238d910d8da88f82 (diff)
downloadgit-repo-d21638424cc92d8fa00e7f440300c92d8532f5a8.tar.gz
tox: get tests passing a bit on Windows
We need to use the path separators provided by the python library, and we need to set the git env vars so the name is always known. Not all tests pass, but at least the basic frameworks work now. Change-Id: Icea67098a8d7d58bbf918c78325681cf12a2e5f2 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255313 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
-rwxr-xr-xrun_tests8
-rw-r--r--tox.ini6
2 files changed, 10 insertions, 4 deletions
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):
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
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
19 19
20[testenv] 20[testenv]
21deps = pytest 21deps = pytest
22commands = {toxinidir}/run_tests 22commands = {envpython} run_tests
23setenv =
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]
25deps = 29deps =