Move the pytest config

This commit is contained in:
Alexander Hess 2026-11-25 14:43:31 +01:00
commit 03617d5bbb
Signed by: alexander
GPG key ID: B46EDB4DFC26805D
4 changed files with 27 additions and 17 deletions

View file

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

View file

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

View file

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

View file

@ -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')