Skip to content

Commit

Permalink
fix test on older python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
amol- committed Mar 25, 2024
1 parent b047018 commit 942335e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_util.py
Expand Up @@ -157,7 +157,9 @@ def test_py38_support(self):
def test_filenotfound(self):
exc = FileNotFoundError()
exc.filename = "FILENAME"
with mock.patch("importlib.resources.as_file", create=True, side_effect=exc):
with mock.patch("importlib.resources", new=mock.MagicMock(
as_file=mock.MagicMock(side_effect=exc)
)):
res = DottedFileNameFinder().get_dotted_filename('tg.tests_test_filenotfound')
assert res == os.path.abspath("FILENAME")

Expand Down

0 comments on commit 942335e

Please sign in to comment.