-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathpytest.ini
More file actions
36 lines (36 loc) · 2.24 KB
/
Copy pathpytest.ini
File metadata and controls
36 lines (36 loc) · 2.24 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]
testpaths = test
python_files = test_*.py
markers =
lilv: tests that initialize the global lilv world (opt-in; run with -m lilv).
Deliberately excluded from the default run by addopts below -- see
docs/characterization-phase-6.md. These tests call modtools.utils.init(),
which is process-global and has no de-init in this suite (cleanup()
exists but is intentionally not called -- see test/test_effects_lilv.py).
A combined run (`pytest -m "(lilv or not lilv) and not lilv_fixture"`
-- see the lilv_fixture marker below for why the "and not lilv_fixture"
is required) was verified green with no observed leakage into other
tests as of phase 6, but -m lilv should still be treated as its own
invocation in CI to keep the blast radius of a lilv/JACK-adjacent
regression contained to one job.
lilv_fixture: the phase-6 stretch-goal tests (test/test_effects_lilv_fixture.py)
that scan a hand-written, binaryless .lv2 bundle. Opt-in; run with
-m lilv_fixture, and ONLY that -- as its OWN, separate pytest
invocation. DO NOT run together with -m lilv: modtools.utils.init()
is only safe to call ONCE per process. Calling it a second time (this
module's fixture vs. test_effects_lilv.py's) leaves lilv's
process-global NamespaceDefinitions singleton bound to a freed world
-- confirmed by direct reproduction to silently return empty
ports/category data and then SIGSEGV the interpreter on exit. Keeping
this marker's tests in a file of their own, with their own single
init() call and their own `pytest -m lilv_fixture` invocation, is not
a style preference, it is the only way to keep this suite
segfault-free.
DANGER, easy to get wrong: a bare `-m "lilv or not lilv"` (the
phase-6 spec's combined-run check) ALSO collects lilv_fixture tests,
because a lilv_fixture-only test is NOT marked lilv and therefore
satisfies "not lilv" -- that recreates the exact double-init crash
above. When running that combined check, always add
`and not lilv_fixture`:
`pytest -m "(lilv or not lilv) and not lilv_fixture"`.
addopts = -m "not lilv and not lilv_fixture"