Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve automated tests support on Windows #300

Merged
merged 9 commits into from
Mar 8, 2021
11 changes: 9 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ def tests(session):
session.run("pytest", *tests)
return
session.run(
"pytest", "--cov=nox", "--cov-config", ".coveragerc", "--cov-report=", *tests
"pytest",
"--cov=nox",
"--cov-config",
".coveragerc",
"--cov-report=",
*tests,
env={"COVERAGE_FILE": ".coverage.{}".format(session.python)}
)
session.notify("cover")

Expand All @@ -65,6 +71,7 @@ def cover(session):
return

session.install("coverage")
session.run("coverage", "combine")
session.run("coverage", "report", "--fail-under=100", "--show-missing")
session.run("coverage", "erase")

Expand Down Expand Up @@ -94,7 +101,7 @@ def lint(session):
session.run("flake8", "nox", *files)


@nox.session(python="3.8")
@nox.session(python="3.7")
def docs(session):
"""Build the documentation."""
output_dir = os.path.join(session.create_tmp(), "output")
Expand Down
11 changes: 8 additions & 3 deletions tests/test_virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,18 @@ def test_condaenv_create(make_conda):
assert dir_.join("test.txt").check()


@pytest.mark.skipif(IS_WINDOWS, reason="Not testing multiple interpreters on Windows.")
@pytest.mark.skipif(not HAS_CONDA, reason="Missing conda command.")
def test_condaenv_create_interpreter(make_conda):
venv, dir_ = make_conda(interpreter="3.7")
venv.create()
assert dir_.join("bin", "python").check()
assert dir_.join("bin", "python3.7").check()
if IS_WINDOWS:
assert dir_.join("python.exe").check()
assert dir_.join("python37.dll").check()
assert dir_.join("python37.pdb").check()
assert not dir_.join("python37.exe").check()
else:
assert dir_.join("bin", "python").check()
assert dir_.join("bin", "python3.7").check()


@mock.patch("nox.virtualenv._SYSTEM", new="Windows")
Expand Down