Skip to content

Commit

Permalink
Fix ftp test_ls_root_dircache() by restoring internal variable after …
Browse files Browse the repository at this point in the history
…usage to prevent raised exception in __del__ (fsspec#1644)
  • Loading branch information
Astropilot authored Jul 2, 2024
1 parent df042b1 commit 1e2591c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fsspec/implementations/tests/test_ftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,15 @@ def test_ls_root_dircache(ftp):

assert "/" in fs.dircache

ftp_tmp = fs.ftp
fs.ftp = None # Ensure no ftp action will be done after

files2 = fs.ls("/", detail=False)

assert files == files2

fs.ftp = ftp_tmp


@pytest.mark.parametrize("cache_type", ["bytes", "mmap"])
def test_complex(ftp_writable, cache_type):
Expand Down

0 comments on commit 1e2591c

Please sign in to comment.