1- """Automation using nox.
2- """
1+ """Automation using nox."""
2+
33import glob
4- import sys
54
65import nox
76
87nox .options .reuse_existing_virtualenvs = True
9- nox .options .sessions = "lint" , "tests" , "compat"
8+ nox .options .sessions = "lint" , "tests"
109locations = "pytest_test_utils" , "tests.py"
1110
1211
13- @nox .session (
14- python = ["3.7" , "3.8" , "3.9" , "3.10" , "3.11" , "pypy3.8" , "pypy3.9" ]
15- )
12+ @nox .session (python = ["3.7" , "3.8" , "3.9" , "3.10" , "3.11" , "3.12" ])
1613def tests (session : nox .Session ) -> None :
1714 session .install (".[tests]" )
1815 # `pytest --cov` will start coverage after pytest
@@ -21,29 +18,18 @@ def tests(session: nox.Session) -> None:
2118 session .run ("coverage" , "report" , "--show-missing" , "--skip-covered" )
2219
2320
24- @nox .session (python = ["3.7" , "3.8" ])
25- @nox .parametrize ("pytest" , ["3.9.1" , "4.0" , "5.0" , "6.0" ])
26- def compat (session : nox .Session , pytest : str ) -> None :
27- session .install (".[tests]" )
28- session .install (f"pytest=={ pytest } " )
29- session .run ("coverage" , "run" , "-m" , "pytest" , "tests.py" )
30-
31-
3221@nox .session
3322def lint (session : nox .Session ) -> None :
3423 session .install ("pre-commit" )
3524 session .install ("-e" , ".[dev]" )
3625
3726 if session .posargs :
38- args = session .posargs + [ "--all-files" ]
27+ args = [ * session .posargs , "--all-files" ]
3928 else :
4029 args = ["--all-files" , "--show-diff-on-failure" ]
4130
4231 session .run ("pre-commit" , "run" , * args )
4332 session .run ("python" , "-m" , "mypy" )
44- if sys .version_info >= (3 , 11 ):
45- return
46- session .run ("python" , "-m" , "pylint" , * locations )
4733
4834
4935@nox .session
0 commit comments