diff --git a/tests/__init__.py b/tests/__init__.py index e69de29b..9edbc0fa 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1,13 @@ +"""No test downloads a release asset unless it says so. + +The CI job sets RETROBIOS_OFFLINE; a local run of the documented command +did not, and e2e fixtures queried the large-files release and wrote its +answers into the shared .cache/large. A test that serves its own assets +clears the variable for itself. +""" + +from __future__ import annotations + +import os + +os.environ.setdefault("RETROBIOS_OFFLINE", "1") diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index 8fceaf89..5eed1c0a 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -3367,5 +3367,11 @@ class EveryToolRefusesAFlagItWouldDrop(unittest.TestCase): self.assertEqual(proc.returncode, 2, proc.stdout + proc.stderr) + +class TestsRunOffline(unittest.TestCase): + def test_the_package_forbids_downloads(self): + self.assertTrue(os.environ.get("RETROBIOS_OFFLINE")) + + if __name__ == "__main__": unittest.main()