diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index 2edddd32..e76c4b6a 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -48,5 +48,5 @@ jobs: - name: Run unit tests without extra packages as non-root user run: | - python -m pytest pyfakefs/tests/test_issue885.py + python -m pytest pyfakefs/tests/test_issue885.py -vsx shell: bash diff --git a/pyfakefs/tests/test_issue885.py b/pyfakefs/tests/test_issue885.py index eb24d945..22ceed7c 100644 --- a/pyfakefs/tests/test_issue885.py +++ b/pyfakefs/tests/test_issue885.py @@ -1,4 +1,5 @@ import io +import os import pathlib import platform import zipfile @@ -17,9 +18,12 @@ def setUpClass(cls): print(f"{pyfakefs.__version__=}") print(f"{pytest.__version__=}") + print(f"before setUpClassPyfakefs() :: {os.getcwd()=}") cls.setUpClassPyfakefs(allow_root_user=False) zip_filepath = pathlib.Path.cwd() / "foo.zip" + print(f"{str(zip_filepath)=}") + print(f"after setUpClassPyfakefs() :: {os.getcwd()=}") with zipfile.ZipFile(zip_filepath, "w") as zip_handle: with zip_handle.open("nice.txt", "w") as entry_handle: @@ -37,7 +41,9 @@ def test_foobar(self): self.assertTrue(zip_filepath.exists()) # read - with zip_filepath.open("rb") as handle: + # with zip_filepath.open('rb') as handle: + print("X" * 55) + with open(str(zip_filepath), "rb") as handle: print("T" * 55) stream = io.BytesIO(handle.read()) print("U" * 55)