-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
55 lines (45 loc) · 2.19 KB
/
Copy pathconftest.py
File metadata and controls
55 lines (45 loc) · 2.19 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
47
48
49
50
51
52
53
54
55
"""Make the boundary of a pytest run impossible to misread.
c64-https is an assembly project. Its real test suites drive VICE or real
Ultimate 64 hardware and are launched by `python3 tools/run_all_tests.py`
and by the manual rig scripts in `tests/` and `tools/uci/` — not by
pytest. Only a few
pure-logic host-side modules are pytest-runnable, and `pytest.ini` pins
`testpaths` to exactly those.
Without this file, `pytest` at the repo root prints a bare pass count that
reads like whole-project coverage. It is not. See issue #109.
This module deliberately contains no fixtures, no skips and no imports of
pytest: it must stay inert for anyone who does not have pytest installed,
and the repo declares no pytest dependency.
"""
_BOUNDARY = [
"c64-https: pytest runs ONLY the pure-logic host-side modules pinned in",
"pytest.ini `testpaths`. It does NOT run the C64 suites (those need VICE:",
"`python3 tools/run_all_tests.py`) and it does NOT run the live-rig",
"scripts in tests/ (sudo + network rig) or tools/uci/ (real U64E/C64U",
"hardware). A green run here says nothing about any of them.",
]
_EMPTY_RUN = [
"pytest collected nothing from the paths you gave it.",
"If that was `pytest tests/` or `pytest tools/uci/`: both hold manual",
"live-rig scripts (rig_*.py, main() programs needing sudo + a network",
"rig, or real U64E/C64U hardware), not pytest tests. See",
"tests/README.md and tools/uci/README.md for how to run them.",
]
def pytest_report_header(config):
"""Printed in the header of every pytest invocation."""
return _BOUNDARY
def pytest_terminal_summary(terminalreporter, exitstatus, config):
"""Repeat the boundary immediately above the final pass/fail line.
The header scrolls away on a long run; the summary line is the thing
people actually read, so the caveat has to sit next to it.
"""
write = terminalreporter.write_line
terminalreporter.write_sep("=", "scope of this run")
for line in _BOUNDARY:
write(line)
# pytest.ExitCode.NO_TESTS_COLLECTED == 5, spelled numerically so this
# file never has to import pytest.
if exitstatus == 5:
write("")
for line in _EMPTY_RUN:
write(line)