4343def tests (session : nox .Session ) -> None :
4444 """Run test suite with pytest."""
4545
46- coverage_file = f".coverage.{ sys .platform } .{ session .python } "
46+ coverage_file = f".coverage.pypi. { sys .platform } .{ session .python } "
4747
4848 session .create_tmp () # Fixes permission errors on Windows
4949 session .install (* PYPROJECT ["dependency-groups" ]["test" ], "uv" )
5050 session .install ("-e.[tox_to_nox,pbs]" )
51- extra_env = {"PYTHONWARNDEFAULTENCODING" : "1" }
5251 session .run (
5352 "pytest" ,
5453 "--cov" ,
5554 "--cov-config" ,
5655 "pyproject.toml" ,
5756 "--cov-report=" ,
57+ "--numprocesses=auto" ,
58+ "-m" ,
59+ "not conda" ,
5860 * session .posargs ,
5961 env = {
62+ "PYTHONWARNDEFAULTENCODING" : "1" ,
6063 "COVERAGE_FILE" : coverage_file ,
61- ** extra_env ,
6264 },
6365 )
6466
@@ -78,42 +80,47 @@ def minimums(session: nox.Session) -> None:
7880 session .run ("pytest" , * session .posargs )
7981
8082
81- @nox .session (venv_backend = "conda" , default = bool (shutil .which ("conda" )))
82- def conda_tests (session : nox .Session ) -> None :
83- """Run test suite set up with conda."""
83+ def xonda_tests (session : nox .Session , xonda : str ) -> None :
84+ """Run test suite set up with conda/mamba/etc."""
85+
86+ coverage_file = f".coverage.{ xonda } .{ sys .platform } .{ session .python } "
87+
8488 session .conda_install (
8589 "--file" , "requirements-conda-test.txt" , channel = "conda-forge"
8690 )
8791 session .install ("-e." , "--no-deps" )
8892 # Currently, this doesn't work on Windows either with or without quoting
8993 if not sys .platform .startswith ("win32" ):
9094 session .conda_install ("requests<99" )
91- session .run ("pytest" , * session .posargs )
95+ session .run (
96+ "pytest" ,
97+ "--cov" ,
98+ "--cov-config" ,
99+ "pyproject.toml" ,
100+ "--cov-report=" ,
101+ "-m" ,
102+ "conda" ,
103+ * session .posargs ,
104+ env = {"COVERAGE_FILE" : coverage_file },
105+ )
106+
107+
108+ @nox .session (venv_backend = "conda" , default = bool (shutil .which ("conda" )))
109+ def conda_tests (session : nox .Session ) -> None :
110+ """Run test suite set up with conda."""
111+ xonda_tests (session , "conda" )
92112
93113
94114@nox .session (venv_backend = "mamba" , default = shutil .which ("mamba" ))
95115def mamba_tests (session : nox .Session ) -> None :
96116 """Run test suite set up with mamba."""
97- session .conda_install (
98- "--file" , "requirements-conda-test.txt" , channel = "conda-forge"
99- )
100- session .install ("-e." , "--no-deps" )
101- if not sys .platform .startswith ("win32" ):
102- session .conda_install ("requests<99" )
103- session .run ("pytest" , * session .posargs )
117+ xonda_tests (session , "mamba" )
104118
105119
106120@nox .session (venv_backend = "micromamba" , default = shutil .which ("micromamba" ))
107121def micromamba_tests (session : nox .Session ) -> None :
108122 """Run test suite set up with micromamba."""
109- session .conda_install (
110- "--file" , "requirements-conda-test.txt" , channel = "conda-forge"
111- )
112- # Currently, this doesn't work on Windows either with or without quoting
113- session .install ("-e." , "--no-deps" )
114- if not sys .platform .startswith ("win32" ):
115- session .conda_install ("requests<99" )
116- session .run ("pytest" , * session .posargs )
123+ xonda_tests (session , "micromamba" )
117124
118125
119126@nox .session (default = False )
0 commit comments