Skip to content

Commit

Permalink
Second test variant
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbean-bremen committed Sep 18, 2023
1 parent 6541ef2 commit 0f6b56e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 7 additions & 1 deletion pyfakefs/tests/test_issue885.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import io
import os
import pathlib
import platform
import zipfile
Expand All @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit 0f6b56e

Please sign in to comment.