use shared test function to replicate .testfiles setup

* It should include a subdir named after the test case.
* self.testdir is the common var name for this.
* tmp_repo is not a repo/ subdir, but instead the root of the whole repo
This commit is contained in:
Hans-Christoph Steiner 2025-02-12 15:18:18 +01:00
parent 820abbc876
commit efce0ce0e4
2 changed files with 30 additions and 28 deletions

View file

@ -79,7 +79,7 @@ def mkdir_testfiles(localmodule, test):
testroot.mkdir(exist_ok=True)
testdir = testroot / unittest.TestCase.id(test)
testdir.mkdir(exist_ok=True)
return tempfile.mkdtemp(dir=testdir)
return Path(tempfile.mkdtemp(dir=testdir))
def mock_urlopen(status=200, body=None):