Skip to content

Commit 419b98a

Browse files
authored
tests: fix test for conda env when conda isn't installed (#794)
1 parent 545a621 commit 419b98a

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

tests/test_sessions.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import logging
1919
import operator
2020
import os
21+
import shutil
2122
import sys
2223
import tempfile
2324
from pathlib import Path
@@ -33,6 +34,9 @@
3334
from nox import _options
3435
from nox.logger import logger
3536

37+
HAS_CONDA = shutil.which("conda") is not None
38+
has_conda = pytest.mark.skipif(not HAS_CONDA, reason="Missing conda command.")
39+
3640

3741
def test__normalize_path():
3842
envdir = "envdir"
@@ -946,7 +950,12 @@ def test__create_venv(self, create):
946950
nox.virtualenv.VirtualEnv,
947951
),
948952
("nox.virtualenv.VirtualEnv.create", "venv", nox.virtualenv.VirtualEnv),
949-
("nox.virtualenv.CondaEnv.create", "conda", nox.virtualenv.CondaEnv),
953+
pytest.param(
954+
"nox.virtualenv.CondaEnv.create",
955+
"conda",
956+
nox.virtualenv.CondaEnv,
957+
marks=has_conda,
958+
),
950959
],
951960
)
952961
def test__create_venv_options(self, create_method, venv_backend, expected_backend):

0 commit comments

Comments
 (0)