From b0470183986965c7c7ff94c428bb5979ae150977 Mon Sep 17 00:00:00 2001 From: Alessandro Molina Date: Mon, 25 Mar 2024 21:25:40 +0000 Subject: [PATCH] fix test on older python versions --- tests/test_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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")