3939 from nox .virtualenv import CondaEnv , ProcessEnv , VirtualEnv
4040
4141IS_WINDOWS = sys .platform .startswith ("win" )
42- HAS_CONDA = shutil .which ("conda" ) is not None
4342HAS_UV = shutil .which ("uv" ) is not None
4443RAISE_ERROR = "RAISE_ERROR"
4544VIRTUALENV_VERSION = metadata .version ("virtualenv" )
4645
4746has_uv = pytest .mark .skipif (not HAS_UV , reason = "Missing uv command." )
48- has_conda = pytest .mark .skipif (not HAS_CONDA , reason = "Missing conda command." )
4947
5048
5149class TextProcessResult (NamedTuple ):
@@ -171,7 +169,6 @@ def test_condaenv_constructor_explicit(
171169 assert venv .reuse_existing is True
172170
173171
174- @has_conda
175172def test_condaenv_create (make_conda : Callable [..., tuple [CondaEnv , Path ]]) -> None :
176173 venv , dir_ = make_conda ()
177174 venv .create ()
@@ -200,7 +197,6 @@ def test_condaenv_create(make_conda: Callable[..., tuple[CondaEnv, Path]]) -> No
200197 assert venv ._reused
201198
202199
203- @has_conda
204200def test_condaenv_create_with_params (
205201 make_conda : Callable [..., tuple [CondaEnv , Path ]],
206202) -> None :
@@ -214,7 +210,6 @@ def test_condaenv_create_with_params(
214210 assert dir_ .joinpath ("bin" , "pip" ).exists ()
215211
216212
217- @has_conda
218213def test_condaenv_create_interpreter (
219214 make_conda : Callable [..., tuple [CondaEnv , Path ]],
220215) -> None :
@@ -230,7 +225,6 @@ def test_condaenv_create_interpreter(
230225 assert dir_ .joinpath ("bin" , "python3.12" ).exists ()
231226
232227
233- @has_conda
234228def test_conda_env_create_verbose (
235229 make_conda : Callable [..., tuple [CondaEnv , Path ]],
236230) -> None :
@@ -262,13 +256,11 @@ def test_condaenv_bin_windows(make_conda: Callable[..., tuple[CondaEnv, Path]])
262256 ] == venv .bin_paths
263257
264258
265- @has_conda
266259def test_condaenv_ (make_conda : Callable [..., tuple [CondaEnv , Path ]]) -> None :
267260 venv , _dir = make_conda ()
268261 assert not venv .is_offline ()
269262
270263
271- @has_conda
272264def test_condaenv_detection (make_conda : Callable [..., tuple [CondaEnv , Path ]]) -> None :
273265 venv , dir_ = make_conda ()
274266 venv .create ()
@@ -556,7 +548,7 @@ def test_not_stale_virtualenv_environment(
556548 assert reused
557549
558550
559- @has_conda
551+ @pytest . mark . conda
560552def test_stale_virtualenv_to_conda_environment (
561553 make_one : Callable [..., tuple [VirtualEnv | ProcessEnv , Path ]],
562554) -> None :
@@ -571,7 +563,7 @@ def test_stale_virtualenv_to_conda_environment(
571563 assert not reused
572564
573565
574- @has_conda
566+ @pytest . mark . conda
575567def test_reuse_conda_environment (
576568 make_one : Callable [..., tuple [VirtualEnv | ProcessEnv , Path ]],
577569) -> None :
@@ -587,7 +579,7 @@ def test_reuse_conda_environment(
587579
588580
589581# This mocks micromamba so that it doesn't need to be installed.
590- @has_conda
582+ @pytest . mark . conda
591583def test_micromamba_environment (
592584 make_one : Callable [..., tuple [VirtualEnv | ProcessEnv , Path ]],
593585 monkeypatch : pytest .MonkeyPatch ,
@@ -612,7 +604,7 @@ def test_micromamba_environment(
612604 "params" ,
613605 [["--channel=default" ], ["-cdefault" ], ["-c" , "default" ], ["--channel" , "default" ]],
614606)
615- @has_conda
607+ @pytest . mark . conda
616608def test_micromamba_channel_environment (
617609 make_one : Callable [..., tuple [VirtualEnv , Path ]],
618610 monkeypatch : pytest .MonkeyPatch ,
@@ -643,7 +635,7 @@ def test_micromamba_channel_environment(
643635 ("venv" , "virtualenv" , True ),
644636 ("virtualenv" , "uv" , True ),
645637 pytest .param ("uv" , "virtualenv" , False , marks = has_uv ),
646- pytest .param ("conda" , "virtualenv" , False , marks = has_conda ),
638+ pytest .param ("conda" , "virtualenv" , False , marks = pytest . mark . conda ),
647639 ],
648640)
649641def test_stale_environment (
0 commit comments