11"""Automation using nox.
22"""
33import glob
4+ import sys
45
56import nox
67
78nox .options .reuse_existing_virtualenvs = True
8- nox .options .sessions = "lint" , "tests" , "tests-pytest5 "
9+ nox .options .sessions = "lint" , "tests" , "compat "
910locations = "pytest_test_utils" , "tests.py"
1011
1112
@@ -18,10 +19,11 @@ def tests(session: nox.Session) -> None:
1819 session .run ("coverage" , "report" , "--show-missing" , "--skip-covered" )
1920
2021
21- @nox .session (python = ["3.7" ], name = "tests-pytest5" )
22- def tests_pytest5 (session : nox .Session ) -> None :
22+ @nox .session (python = ["3.7" , "3.8" ])
23+ @nox .parametrize ("pytest" , ["5" , "6" ])
24+ def compat (session : nox .Session , pytest : str ) -> None :
2325 session .install (".[tests]" )
24- session .install ("pytest==5.0.0 " )
26+ session .install (f "pytest=={ pytest } " )
2527 session .run ("coverage" , "run" , "-m" , "pytest" , "tests.py" )
2628
2729
@@ -37,6 +39,8 @@ def lint(session: nox.Session) -> None:
3739
3840 session .run ("pre-commit" , "run" , * args )
3941 session .run ("python" , "-m" , "mypy" )
42+ if sys .version_info >= (3 , 11 ):
43+ return
4044 session .run ("python" , "-m" , "pylint" , * locations )
4145
4246
0 commit comments