Skip to content

Commit

Permalink
tests: fix test for conda env when conda isn't installed (#794)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjolowicz authored Mar 5, 2024
1 parent 545a621 commit 419b98a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import logging
import operator
import os
import shutil
import sys
import tempfile
from pathlib import Path
Expand All @@ -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"
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 419b98a

Please sign in to comment.