Skip to content

Commit

Permalink
Creator tests now sensitive to non-existent dirs
Browse files Browse the repository at this point in the history
It breaks cpython3 tests, because they try to access
non-existent DLLs dir, that were not mocked.
  • Loading branch information
reksar committed Jun 28, 2022
1 parent f41b143 commit 963e7da
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/unit/create/via_global_ref/builtin/testing/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 963e7da

Please sign in to comment.