Pull out the TEST_DEPENDENCIES

This commit is contained in:
Alexander Hess 2026-12-01 17:07:45 +01:00
commit 2f313e7e3a
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -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"