From 60babe81410c96c32c53b8559517b3464d0f2f04 Mon Sep 17 00:00:00 2001 From: Tom Fleet Date: Wed, 22 Dec 2021 21:58:34 +0000 Subject: [PATCH] Only run conda_tests session by default if user has conda installed (#521) --- noxfile.py | 5 +++++ tests/test_virtualenv.py | 1 + 2 files changed, 6 insertions(+) diff --git a/noxfile.py b/noxfile.py index 00872946..38781efd 100644 --- a/noxfile.py +++ b/noxfile.py @@ -23,6 +23,11 @@ ON_WINDOWS_CI = "CI" in os.environ and platform.system() == "Windows" +# Skip 'conda_tests' if user doesn't have conda installed +nox.options.sessions = ["tests", "cover", "blacken", "lint", "docs"] +if shutil.which("conda"): + nox.options.sessions.append("conda_tests") + def is_python_version(session, version): if not version.startswith(session.python): diff --git a/tests/test_virtualenv.py b/tests/test_virtualenv.py index 8fe1c410..c1df7119 100644 --- a/tests/test_virtualenv.py +++ b/tests/test_virtualenv.py @@ -233,6 +233,7 @@ def test_condaenv_bin_windows(make_conda): assert [dir_.strpath, dir_.join("Scripts").strpath] == venv.bin_paths +@pytest.mark.skipif(not HAS_CONDA, reason="Missing conda command.") def test_condaenv_(make_conda): venv, dir_ = make_conda() assert not venv.is_offline()