Repository navigation
Expand file tree
/
Copy pathpytest.ini
More file actions
46 lines (46 loc) · 2.85 KB
/
Copy pathpytest.ini
File metadata and controls
46 lines (46 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
[pytest]
testpaths = tests
# No `pythonpath` here any more. It existed for exactly one reason: the rhiza checks were
# synced into `.rhiza/tests/` and had to be importable so the suite's modules could import
# each other. Since #1540 they arrive installed, as pytest-rhiza, so import resolution is
# pip's job and the project's own suite is reached through `testpaths` above.
# Disable live logs on console by default (opt in with: pytest -o log_cli=true --log-cli-level=DEBUG)
log_cli = false
# Show DEBUG+ messages
log_cli_level = DEBUG
log_cli_format = %(asctime)s %(levelname)s %(name)s: %(message)s
log_cli_date_format = %H:%M:%S
# `-ra` shows extra summary info for skipped/failed tests.
#
# Strict: an unregistered marker or an unknown ini key is an error, not a warning that
# scrolls past -- otherwise `-m "not strss"` deselects nothing, or a setting silently does
# nothing when the plugin that reads it is absent, and the run stays green (#1832). That is
# why there is no `timeout` key here: only pytest-timeout knows it, and only rhiza-task's
# `test`, `coverage` and `test-lowest` install that plugin, so they pass `--timeout`
# themselves (rhiza-task 1.12, setting `test_timeout`, default 60).
addopts = -ra --strict-markers --strict-config
# Both rules again as ini keys, and neither spelling is redundant: pytest 9.0.0-9.0.2
# ignore `--strict-markers` and `--strict-config` when they arrive through addopts (fixed in
# 9.1). The keys need pytest>=9: under `--strict-config`, pytest 8 rejects them as unknown.
# tests/bundles/test_pytest_strictness.py runs on every resolution, the lowest included.
strict_markers = true
strict_config = true
# An xfail test that starts passing fails the run, so a fixed bug cannot hide behind its marker.
xfail_strict = true
# Treat the class-scoped-instance-method fixture deprecation as an error so it
# cannot silently regress. Matched by message rather than by warning category:
# the category name is version-specific (PytestRemovedIn9Warning vs ...In10Warning)
# and referencing a missing class breaks `--resolution lowest-direct` runs at
# parse time. Third-party DeprecationWarnings stay non-fatal.
filterwarnings =
error:Class-scoped fixture defined as instance method is deprecated
# Register custom markers
markers =
stress: marks tests as stress tests (deselect with '-m "not stress"')
property: marks tests as property-based tests
kaleido: marks tests that require the kaleido package for static image export
# pytest-timeout registers `timeout` itself, but only the runs that install it -- test,
# coverage, test-lowest -- have it. stress, hypothesis-test and benchmark do not, and
# under --strict-markers every module using @pytest.mark.timeout then fails collection.
# Registered here it is a no-op in those runs, which never had a timeout anyway.
timeout: per-test timeout, enforced where pytest-timeout is installed