From 12528d5a6cdc34620754afbb4aa95186eef55047 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Fri, 19 May 2023 11:58:18 +0100 Subject: [PATCH] Ensure a string is passed to zimiporter --- tests/test_xml/test_get_validated_tree.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_xml/test_get_validated_tree.py b/tests/test_xml/test_get_validated_tree.py index f6d911c..27c0603 100644 --- a/tests/test_xml/test_get_validated_tree.py +++ b/tests/test_xml/test_get_validated_tree.py @@ -1,4 +1,5 @@ # stdlib +import os import pathlib from zipimport import zipimporter @@ -20,7 +21,8 @@ # 3rd party from zipp import Path as ZipPath # type: ignore -test_xml_zipapp = zipimporter(files(tests.test_xml).joinpath("test_xml_zipapp.pyz")).load_module("test_xml_zipapp") +zipapp_path = os.fspath(files(tests.test_xml) / "test_xml_zipapp.pyz") +test_xml_zipapp = zipimporter(zipapp_path).load_module("test_xml_zipapp") shiporder_filename: ZipPath = files(tests.test_xml).joinpath("shiporder.xml") bad_file: ZipPath = files(tests.test_xml).joinpath("bad_file.xml")