From 03617d5bbbc6d73857d827eab44371ae471350fb Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Wed, 25 Nov 2026 14:43:31 +0100 Subject: [PATCH] Move the `pytest` config --- .forgejo/workflows/ci.yml | 2 +- pyproject.toml | 25 +++++++++++++++++++++++++ setup.cfg | 15 --------------- tests/conftest.py | 2 +- 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 8192ad0..3a4f01c 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -59,6 +59,6 @@ jobs: uv venv --python 3.13 --seed .venv poetry sync --no-interaction - # `TESTING=true` comes from `setup.cfg` + # `TESTING=true` comes from `pyproject.toml` - name: Run the test suite run: poetry run pytest -q diff --git a/pyproject.toml b/pyproject.toml index 4a76d17..008f183 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -139,3 +139,28 @@ xdoctest = { version=">=1.3.2,<2", extras=["optional"] } # Documentation sphinx = ">=9.2.0,<10" sphinx-autodoc-typehints = ">=3.17.7,<4" + + + +[tool.pytest.ini_options] +# Source: https://docs.pytest.org/en/stable/reference/reference.html#ini-options-ref + +cache_dir = ".cache/pytest" + +addopts = "--strict-markers" + +console_output_style = "count" + +env = [ + "TESTING=true", +] + +filterwarnings = [ + "ignore:::patsy.*", +] + +markers = [ + "db: (integration) tests touching the database", + "e2e: non-db and non-r integration tests", + "r: (integration) tests using rpy2", +] diff --git a/setup.cfg b/setup.cfg index 454c95d..b48a844 100644 --- a/setup.cfg +++ b/setup.cfg @@ -301,18 +301,3 @@ ignore_missing_imports = true ignore_missing_imports = true [mypy-utm.*] ignore_missing_imports = true - - -[tool:pytest] -addopts = - --strict-markers -cache_dir = .cache/pytest -console_output_style = count -env = - TESTING=true -filterwarnings = - ignore:::patsy.* -markers = - db: (integration) tests touching the database - e2e: non-db and non-r integration tests - r: (integration) tests using rpy2 diff --git a/tests/conftest.py b/tests/conftest.py index c59d04e..2e7c583 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -19,7 +19,7 @@ from velofy import db # The TESTING environment variable is set -# in setup.cfg in pytest's config section. +# in pyproject.toml in pytest's config section. if not os.getenv('TESTING'): raise RuntimeError('Tests must be executed with TESTING set in the environment')