fix: isolate every test module however it runs

tests/__init__.py keeps a run offline, its scratch under tmp/ and its
installer cache its own, but only discover -s tests -t . imported it.
discover tests ran with RETROBIOS_OFFLINE unset, scratch on the /tmp
tmpfs and the user's real installer cache, the setting in which e2e
fixtures had written into the shared .cache/large. Every test module now
imports the package first, and a test fails on a module that does not.
test_verify_listing.py took its line with the previous commit.
This commit is contained in:
Abdessamad Derraz committed 2026-11-06 15:14:05 +01:00
1 parent 7dcb427e27
commit 057fd2d0f6
250 files changed
+546 -2

No files matched your search

+8 -2
View File
@@ -222,8 +222,14 @@ disambiguated by a hash suffix on purpose.
output or formatting.
5. **Run the full suite.** After adding your test, run `python -m unittest
discover -s tests -t . -v` to verify nothing else broke. `-t .` imports
`tests/__init__.py`, which keeps the suite offline.
discover -s tests -t . -v` to verify nothing else broke.
A new module starts with `import tests` right after
`from __future__ import annotations`. The package import is what keeps a run
offline, puts its scratch under `tmp/` and gives it its own installer cache,
however the module is started: `discover tests`, `python -m unittest
tests.test_e2e` or `python -m tests.test_e2e`. A test fails on any module
without it.
A fix comes with a test that fails without it. Write the test first, watch it
fail on the current code, then fix: a test written after the fix may never