From 2f313e7e3ab33f92ea6b99ba0554e026dbb88191 Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Tue, 1 Dec 2026 17:07:45 +0100 Subject: [PATCH] Pull out the `TEST_DEPENDENCIES` --- noxfile.py | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/noxfile.py b/noxfile.py index 4e47c08..94548e3 100644 --- a/noxfile.py +++ b/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"