diff --git a/tests/test_sessions.py b/tests/test_sessions.py index 98478a60..ff09e42a 100644 --- a/tests/test_sessions.py +++ b/tests/test_sessions.py @@ -18,6 +18,7 @@ import logging import operator import os +import shutil import sys import tempfile from pathlib import Path @@ -33,6 +34,9 @@ from nox import _options from nox.logger import logger +HAS_CONDA = shutil.which("conda") is not None +has_conda = pytest.mark.skipif(not HAS_CONDA, reason="Missing conda command.") + def test__normalize_path(): envdir = "envdir" @@ -946,7 +950,12 @@ def test__create_venv(self, create): nox.virtualenv.VirtualEnv, ), ("nox.virtualenv.VirtualEnv.create", "venv", nox.virtualenv.VirtualEnv), - ("nox.virtualenv.CondaEnv.create", "conda", nox.virtualenv.CondaEnv), + pytest.param( + "nox.virtualenv.CondaEnv.create", + "conda", + nox.virtualenv.CondaEnv, + marks=has_conda, + ), ], ) def test__create_venv_options(self, create_method, venv_backend, expected_backend):