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." )(
49- pytest .mark .xdist_group (name = "conda" )
50- )
5147
5248
5349class TextProcessResult (NamedTuple ):
@@ -173,7 +169,6 @@ def test_condaenv_constructor_explicit(
173169 assert venv .reuse_existing is True
174170
175171
176- @has_conda
177172def test_condaenv_create (make_conda : Callable [..., tuple [CondaEnv , Path ]]) -> None :
178173 venv , dir_ = make_conda ()
179174 venv .create ()
@@ -202,7 +197,6 @@ def test_condaenv_create(make_conda: Callable[..., tuple[CondaEnv, Path]]) -> No
202197 assert venv ._reused
203198
204199
205- @has_conda
206200def test_condaenv_create_with_params (
207201 make_conda : Callable [..., tuple [CondaEnv , Path ]],
208202) -> None :
@@ -216,7 +210,6 @@ def test_condaenv_create_with_params(
216210 assert dir_ .joinpath ("bin" , "pip" ).exists ()
217211
218212
219- @has_conda
220213def test_condaenv_create_interpreter (
221214 make_conda : Callable [..., tuple [CondaEnv , Path ]],
222215) -> None :
@@ -232,7 +225,6 @@ def test_condaenv_create_interpreter(
232225 assert dir_ .joinpath ("bin" , "python3.12" ).exists ()
233226
234227
235- @has_conda
236228def test_conda_env_create_verbose (
237229 make_conda : Callable [..., tuple [CondaEnv , Path ]],
238230) -> None :
@@ -264,13 +256,11 @@ def test_condaenv_bin_windows(make_conda: Callable[..., tuple[CondaEnv, Path]])
264256 ] == venv .bin_paths
265257
266258
267- @has_conda
268259def test_condaenv_ (make_conda : Callable [..., tuple [CondaEnv , Path ]]) -> None :
269260 venv , _dir = make_conda ()
270261 assert not venv .is_offline ()
271262
272263
273- @has_conda
274264def test_condaenv_detection (make_conda : Callable [..., tuple [CondaEnv , Path ]]) -> None :
275265 venv , dir_ = make_conda ()
276266 venv .create ()
@@ -555,7 +545,7 @@ def test_not_stale_virtualenv_environment(
555545 assert reused
556546
557547
558- @has_conda
548+ @pytest . mark . conda
559549def test_stale_virtualenv_to_conda_environment (
560550 make_one : Callable [..., tuple [VirtualEnv | ProcessEnv , Path ]],
561551) -> None :
@@ -570,7 +560,7 @@ def test_stale_virtualenv_to_conda_environment(
570560 assert not reused
571561
572562
573- @has_conda
563+ @pytest . mark . conda
574564def test_reuse_conda_environment (
575565 make_one : Callable [..., tuple [VirtualEnv | ProcessEnv , Path ]],
576566) -> None :
@@ -586,7 +576,7 @@ def test_reuse_conda_environment(
586576
587577
588578# This mocks micromamba so that it doesn't need to be installed.
589- @has_conda
579+ @pytest . mark . conda
590580def test_micromamba_environment (
591581 make_one : Callable [..., tuple [VirtualEnv | ProcessEnv , Path ]],
592582 monkeypatch : pytest .MonkeyPatch ,
@@ -611,7 +601,7 @@ def test_micromamba_environment(
611601 "params" ,
612602 [["--channel=default" ], ["-cdefault" ], ["-c" , "default" ], ["--channel" , "default" ]],
613603)
614- @has_conda
604+ @pytest . mark . conda
615605def test_micromamba_channel_environment (
616606 make_one : Callable [..., tuple [VirtualEnv , Path ]],
617607 monkeypatch : pytest .MonkeyPatch ,
@@ -642,7 +632,7 @@ def test_micromamba_channel_environment(
642632 ("venv" , "virtualenv" , True ),
643633 ("virtualenv" , "uv" , True ),
644634 pytest .param ("uv" , "virtualenv" , False , marks = has_uv ),
645- pytest .param ("conda" , "virtualenv" , False , marks = has_conda ),
635+ pytest .param ("conda" , "virtualenv" , False , marks = pytest . mark . conda ),
646636 ],
647637)
648638def test_stale_environment (
0 commit comments