-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathpytest.ini
More file actions
36 lines (36 loc) · 2.1 KB
/
Copy pathpytest.ini
File metadata and controls
36 lines (36 loc) · 2.1 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
[pytest]
# Use importlib import mode so duplicate test basenames across the two test
# trees (e.g. tests/hooks/test_destructive_guard.py and
# plugins/dev-team/tests/hooks/test_destructive_guard.py) no longer collide at
# collection time. The default `prepend` mode inserts each test's directory on
# sys.path and imports by bare basename, so the second same-named module aborts
# collection with an "import file mismatch". `importlib` imports each file under
# a unique key and never mutates sys.path, letting the full suite run in one
# invocation: `python3 -m pytest tests plugins/dev-team/tests`. See issue #1120.
addopts = --import-mode=importlib
# importlib never puts a test's own directory on sys.path (unlike prepend), so a
# couple of test dirs whose modules import a sibling helper by bare name need
# that directory made importable explicitly. Modules-under-test are unaffected:
# those tests insert their own sys.path entries. tests/stack_aware -> _stack_aware_helpers,
# tests/skills -> skill_doc_helpers, tests/agents -> _plugin_dirs, tests/scripts ->
# _mutation_test_helpers (shared SCRIPTS_DIR/FORBIDDEN_LITERALS constants,
# issue #1554), repo root -> _repo_root (shared REPO_ROOT constant, replacing per-file
# Path(__file__).resolve().parents[N] computation across the test corpus) and
# _content_guard_scan (shared plugin-markdown scan surface, issues #1655/#1656),
# and _ci_local_invocation (shared ci-local.sh source parsers — a
# pytest-invocation parser and a registry-array parser — for the
# floor/ceiling gate tests, issue #1887).
pythonpath =
.
tests/stack_aware
tests/skills
tests/agents
tests/scripts
# pytest-xdist's own marker, used to force a set of tests that share mutable
# filesystem state (a fixed /tmp path, no per-worker isolation) onto a single
# worker so `-n auto` can't interleave them into a race. Registering it here
# silences PytestUnknownMarkWarning and — more importantly — is required for
# `--dist loadgroup` to actually group by it rather than ignore an unknown
# mark. See issue #1495.
markers =
xdist_group: pytest-xdist worker-grouping marker (see issue #1495)