diff --git a/tests/test_util.py b/tests/test_util.py index 3a85ee9d..626c8711 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -157,7 +157,7 @@ def test_py38_support(self): def test_filenotfound(self): exc = FileNotFoundError() exc.filename = "FILENAME" - with mock.patch("importlib.resources.as_file", side_effect=exc): + with mock.patch("importlib.resources.as_file", create=True, side_effect=exc): res = DottedFileNameFinder().get_dotted_filename('tg.tests_test_filenotfound') assert res == os.path.abspath("FILENAME")