@@ -285,31 +285,25 @@ def prerelease(session, tests_path):
285285 )
286286
287287
288- @nox .session (python = UNIT_TEST_PYTHON_VERSIONS [- 1 ])
289- def compliance (session ):
290- """Run the compliance test suite."""
291- default (session , os .path .join ("tests" , "compliance" ))
292-
293-
294- @nox .session (python = UNIT_TEST_PYTHON_VERSIONS [- 1 ])
295- def compliance_prerelease (session ):
296- """Run the compliance test suite with prerelease dependencies."""
297- prerelease (session , os .path .join ("tests" , "compliance" ))
298-
299-
300288@nox .session (python = ALL_PYTHON )
301- def unit (session ):
289+ @nox .parametrize ("test_type" , ["unit" , "compliance" ])
290+ def unit (session , test_type ):
302291 """Run the unit test suite."""
303-
304- if session .python in ("3.7" ,):
292+ if session .python == "3.7" :
305293 session .skip ("Python 3.7 is no longer supported" )
306- default (session , os .path .join ("tests" , "unit" ))
294+
295+ # Compliance tests only run on the latest Python version
296+ if test_type == "compliance" and session .python != DEFAULT_PYTHON_VERSION :
297+ session .skip (f"Compliance tests are only run on the latest Python: { DEFAULT_PYTHON_VERSION } " )
298+
299+ default (session , os .path .join ("tests" , test_type ))
307300
308301
309302@nox .session (python = UNIT_TEST_PYTHON_VERSIONS [- 1 ])
310- def unit_prerelease (session ):
303+ @nox .parametrize ("test_type" , ["unit" , "compliance" ])
304+ def unit_prerelease (session , test_type ):
311305 """Run the unit test suite with prerelease dependencies."""
312- prerelease (session , os .path .join ("tests" , "unit" ))
306+ prerelease (session , os .path .join ("tests" , test_type ))
313307
314308
315309def install_systemtest_dependencies (session , * constraints ):
0 commit comments