refactor: one owner for the test scratch folder

Test modules passed dir= the repository's tmp/ or a hard-coded tmp/tests by hand, and seven modules kept their own _tempdir copy. Under run_tests.py the literal tmp/tests did not exist in a fresh clone (FileNotFoundError in test_core_probe and scratch_checkout), and dir=tmp/ wrote beside the per-module scratch folders. Every temporary directory now lands in the folder tests/__init__ sets, and scratch_dir() replaces the copies. The X socket binds by a relative name, since a scratch path can exceed the 108-byte AF_UNIX limit. The journeys keep the short tmp/ root: their word budgets count the printed card path.
This commit is contained in:
Abdessamad Derraz committed 2026-11-21 06:04:40 +01:00
1 parent ec50bf6b41
commit fbbb941e38
127 files changed
+665 -826

No files matched your search

+3 -3
View File
@@ -35,7 +35,7 @@ class ATargetedModelIsItsOwnArtifact(unittest.TestCase):
def test_a_target_writes_beside_the_full_model(self):
repo = pathlib.Path(__file__).resolve().parent.parent
with tempfile.TemporaryDirectory(dir=str(repo / "tmp")) as directory:
with tempfile.TemporaryDirectory() as directory:
for extra in ([], ["--target", "browser"]):
proc = subprocess.run(
[sys.executable, "scripts/generate_truth.py", "--platform",
@@ -58,7 +58,7 @@ class ATargetedModelIsItsOwnArtifact(unittest.TestCase):
"""bizhawk --target switch printed "skipped", then Done., exit 0,
and wrote no model: the diff after it failed instead."""
repo = pathlib.Path(__file__).resolve().parent.parent
with tempfile.TemporaryDirectory(dir=str(repo / "tmp")) as directory:
with tempfile.TemporaryDirectory() as directory:
proc = subprocess.run(
[sys.executable, "scripts/generate_truth.py", "--platform", "bizhawk",
"--target", "switch", "--output-dir", directory],
@@ -75,7 +75,7 @@ class ADiffThatComparedNothingFails(unittest.TestCase):
def test_an_empty_truth_directory_is_an_error(self):
repo = pathlib.Path(__file__).resolve().parent.parent
with tempfile.TemporaryDirectory(dir=str(repo / "tmp")) as directory:
with tempfile.TemporaryDirectory() as directory:
for selection in (["--all"], ["--platform", "retroarch"]):
proc = subprocess.run(
[sys.executable, "scripts/diff_truth.py", *selection,