Skip to content

Commit

Permalink
Windows fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat committed Jun 22, 2018
1 parent f7ca369 commit 9eae7f8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/tox/venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ def _pcall(
env = self._getenv(testcommand=testcommand)
bindir = str(self.envconfig.envbindir)
env["PATH"] = p = os.pathsep.join([bindir, os.environ["PATH"]])
env.pop("PYTHONPATH", None)
self.session.report.verbosity2("setting PATH={}".format(p))
return action.popen(args, cwd=cwd, env=env, redirect=redirect, ignore_ret=ignore_ret)

Expand Down
29 changes: 17 additions & 12 deletions tests/test_package_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def test_pyproject_toml_with_setuptools_scm(initproj, cmd):
[testenv]
passenv = PYTHONPATH
commands = python -c 'import demo; print(demo.__version__)'
commands = python -c 'import demo; print(demo.__version__, end="")'
""",
},
)
Expand All @@ -133,23 +133,28 @@ def test_pyproject_toml_with_setuptools_scm(initproj, cmd):
env["EMAIL"] = "[email protected]"
subprocess.check_call(["git", "init"], env=env)
subprocess.check_call(["git", "add", "."], env=env)
subprocess.check_call(["git", "config", "commit.gpgsign", "false"], env=env)
subprocess.check_call(["git", "commit", "-m", "first commit"], env=env)
subprocess.check_call(["git", "tag", "0.1"], env=env)

result = cmd()
expected = textwrap.dedent(
""" GLOB wheel-make: {0}/setup.py
py create: {0}/.tox/py
py inst: {0}/.tox/dist/demo-0.1-py2.py3-none-any.whl
base = textwrap.dedent(
""" GLOB wheel-make: {}
py create: {}
py inst: {}
py installed: demo==0.1
py runtests: PYTHONHASHSEED='{1}'
py runtests: commands[0] | python -c 'import demo; print(demo.__version__)'
0.1
___________________________________ summary ____________________________________
py runtests: PYTHONHASHSEED='{}'
py runtests: commands[0] | python -c 'import demo; print(demo.__version__, end="")'
0.1___________________________________ summary ___________________________________
py: commands succeeded
congratulations :)
""".format(
os.getcwd(), result.python_hash_seed
)
"""
)
cwd = os.getcwd()
expected = base.format(
os.path.join(cwd, "setup.py"),
os.path.join(cwd, ".tox", "py"),
os.path.join(cwd, ".tox", "dist", "demo-0.1-py2.py3-none-any.whl"),
result.python_hash_seed,
)
assert result.out == expected

0 comments on commit 9eae7f8

Please sign in to comment.