Skip to content

Commit

Permalink
[style] Avoid lint warnings about shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmlnkn committed Oct 19, 2024
1 parent 7a04981 commit c8d1eb5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/tests/test_SQLiteIndexedTarFsspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ def test_pandas():
# same error during that close call, i.e., it is already too late at that point. I'm not sure
# why it is too late there but not too late during the SQLiteIndexedTar destructor...
# Maybe there are also some cyclic dependencies?
with tempfile.TemporaryDirectory(suffix=".test.ratarmount") as folderPath:
with tempfile.TemporaryDirectory(suffix=".test.ratarmount") as folderPath2:
contents = os.urandom(96 * 1024 * 1024)

tarPath = os.path.join(folderPath, "random-data.tar.gz")
tarPath = os.path.join(folderPath2, "random-data.tar.gz")
with tarfile.open(name=tarPath, mode="w:gz") as tarArchive:
# Must create a sufficiently large .tar.gz so that rapidgzip is actually used.
# In the future this "has multiple chunks" rapidgzip test is to be removed and
Expand All @@ -113,8 +113,8 @@ def test_pandas():
# Only global variables trigger the "Detected Python finalization from running rapidgzip thread." bug.
# I am not sure why. Probably, because it gets garbage-collected later.
globalOpenFile = fsspec.open("ratar://random-data::file://" + tarPath)
with globalOpenFile as file:
assert file.read() == contents
with globalOpenFile as openedFile2:
assert openedFile2.read() == contents

# This is still some step the user has to do, but it cannot be avoided.
# It might be helpful if fsspec had some kind of better resource management for filesystems though.
Expand Down

0 comments on commit c8d1eb5

Please sign in to comment.