From 963e7da6615a5781434f7f7848e79336c35709d6 Mon Sep 17 00:00:00 2001 From: reksarka Date: Tue, 28 Jun 2022 17:39:34 +0300 Subject: [PATCH] Creator tests now sensitive to non-existent dirs It breaks cpython3 tests, because they try to access non-existent DLLs dir, that were not mocked. --- tests/unit/create/via_global_ref/builtin/testing/path.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/unit/create/via_global_ref/builtin/testing/path.py b/tests/unit/create/via_global_ref/builtin/testing/path.py index ece41cf51..93ebea582 100644 --- a/tests/unit/create/via_global_ref/builtin/testing/path.py +++ b/tests/unit/create/via_global_ref/builtin/testing/path.py @@ -18,6 +18,7 @@ class FakeDataABC(object): @property @abstractmethod def filelist(self): + """To mock a dir, just mock any child file.""" raise NotImplementedError("Collection of (str) file paths to mock") @property @@ -65,6 +66,8 @@ def resolve(self): return self def iterdir(self): + if not self.is_dir(): + raise FileNotFoundError("No such mocked dir: '{}'".format(self)) for path in map(self.joinpath, self.contained_fake_names): yield path