Pull out the TEST_DEPENDENCIES
This commit is contained in:
parent
5f7d3108de
commit
2f313e7e3a
1 changed files with 15 additions and 25 deletions
40
noxfile.py
40
noxfile.py
|
|
@ -94,6 +94,19 @@ SCRIPTS_LOCATION = "scripts/"
|
|||
|
||||
TESTS_LOCATION = "tests/"
|
||||
|
||||
# Packages the "test" and "test-types" sessions need to run the test suite
|
||||
TEST_DEPENDENCIES = (
|
||||
# The tests import `velofy`, so it and its dependencies must be installed
|
||||
".", # => A non-editable copy as it would really be installed
|
||||
"factory-boy",
|
||||
"Faker",
|
||||
"packaging",
|
||||
"pytest",
|
||||
"pytest-cov",
|
||||
"pytest-env",
|
||||
"pytest-mock",
|
||||
)
|
||||
|
||||
# Locations that `mypy` and `pyright` always check as a whole
|
||||
TYPECHECK_LOCATIONS = (
|
||||
NOXFILE_LOCATION,
|
||||
|
|
@ -110,7 +123,6 @@ SRC_LOCATIONS = (
|
|||
TESTS_LOCATION,
|
||||
)
|
||||
|
||||
|
||||
SUPPORTED_PYTHONS = load_supported_python_versions()
|
||||
|
||||
# Must be listed in the "classifiers", which is checked at the bottom
|
||||
|
|
@ -276,18 +288,7 @@ def test_code(session: nox.Session) -> None:
|
|||
"""
|
||||
start(session)
|
||||
|
||||
install_pinned(
|
||||
session,
|
||||
# The tests import `velofy`, so it and its dependencies must be installed
|
||||
".", # => A non-editable copy as it would really be installed
|
||||
"factory-boy",
|
||||
"Faker",
|
||||
"packaging",
|
||||
"pytest",
|
||||
"pytest-cov",
|
||||
"pytest-env",
|
||||
"pytest-mock",
|
||||
)
|
||||
install_pinned(session, *TEST_DEPENDENCIES)
|
||||
|
||||
session.run("pytest", "--version")
|
||||
|
||||
|
|
@ -342,18 +343,7 @@ def test_types(session: nox.Session) -> None:
|
|||
"""
|
||||
start(session)
|
||||
|
||||
install_pinned(
|
||||
session,
|
||||
".",
|
||||
"factory-boy",
|
||||
"Faker",
|
||||
"packaging",
|
||||
"pytest",
|
||||
"pytest-cov",
|
||||
"pytest-env",
|
||||
"pytest-mock",
|
||||
"typeguard",
|
||||
)
|
||||
install_pinned(session, *TEST_DEPENDENCIES, "typeguard")
|
||||
|
||||
# Make tests/__init__.py install the import hook for `typeguard`
|
||||
session.env["TYPEGUARD"] = "true"
|
||||
|
|
|
|||
Loading…
Reference in a new issue