Skip to content

Commit

Permalink
Windows fix
Browse files Browse the repository at this point in the history
Signed-off-by: Bernat Gabor <[email protected]>
  • Loading branch information
gaborbernat committed Jun 20, 2020
1 parent d785ef7 commit 09f9698
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ about the created virtual environment.
.. automodule:: virtualenv
:members:

.. currentmodule:: virtualenv.session
.. currentmodule:: virtualenv.run.session

.. autoclass:: Session
:members:
15 changes: 9 additions & 6 deletions tests/unit/seed/wheels/test_periodic_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,13 @@ def test_trigger_update_no_debug(for_py_version, session_app_data, tmp_path, moc
args, kwargs = Popen.call_args
cmd = (
"from virtualenv.seed.wheels.periodic_update import do_update;"
"do_update({!r}, {!r}, '{}', '{}', ['{}', '{}'], True)".format(
"setuptools", for_py_version, current.path, session_app_data, tmp_path / "a", tmp_path / "b",
"do_update({!r}, {!r}, {!r}, {!r}, [{!r}, {!r}], True)".format(
"setuptools",
for_py_version,
str(current.path),
str(session_app_data),
str(tmp_path / "a"),
str(tmp_path / "b"),
)
)
assert args == ([sys.executable, "-c", cmd],)
Expand All @@ -212,14 +217,12 @@ def test_trigger_update_debug(for_py_version, session_app_data, tmp_path, mocker
args, kwargs = Popen.call_args
cmd = (
"from virtualenv.seed.wheels.periodic_update import do_update;"
"do_update({!r}, {!r}, '{}', '{}', ['{}', '{}'], False)".format(
"pip", for_py_version, current.path, session_app_data, tmp_path / "a", tmp_path / "b",
"do_update({!r}, {!r}, {!r}, {!r}, [{!r}, {!r}], False)".format(
"pip", for_py_version, str(current.path), str(session_app_data), str(tmp_path / "a"), str(tmp_path / "b"),
)
)
assert args == ([sys.executable, "-c", cmd],)
expected = {"stdout": None, "stderr": None}
if sys.platform == "win32":
expected["creationflags"] = DETACHED_PROCESS
assert kwargs == expected
assert process.communicate.call_count == 1

Expand Down

0 comments on commit 09f9698

Please sign in to comment.