pyfilesystem2 icon indicating copy to clipboard operation
pyfilesystem2 copied to clipboard

Make tests compatible with pyftpdlib 2.0

Open musicinmybrain opened this issue 5 months ago • 0 comments

Type of changes

  • Tests

Checklist

  • [x] I've run the latest black with default args on new code.
  • [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate. Is this needed?
  • [x] I've added tests for new code. N/A, testing fixes
  • [x] I accept that @PyFilesystem/maintainers may be pedantic in the code review.

Description

Inspired by @mweinelt via https://github.com/PyFilesystem/pyfilesystem2/pull/591.

  • Updates the pyftpdlib test dependency from ~=1.5 to ~=2.0
  • Uses pyftpdlib’s test extra (introduced in 2.0) to bring in dependencies for pyftpdlib.test, rather than naming them and maintaining their version bounds manually.
  • Follow the renaming of ThreadedTestFTPd to FtpdThreadWrapper

I tested this locally in a Python 3.13 virtualenv, first applying https://github.com/PyFilesystem/pyfilesystem2/pull/570 and https://github.com/PyFilesystem/pyfilesystem2/pull/587. I do find that I can sometimes get all the tests to pass, but there are almost always some flaky failures where it seems like the test FTP server is not ready, like:

====================================== short test summary info =======================================
FAILED tests/test_ftpfs.py::TestFTPFS::test_download_4 - fs.errors.RemoteConnectionError: unable to connect to 127.0.0.1
FAILED tests/test_ftpfs.py::TestFTPFSNoMLSD::test_download_0 - fs.errors.RemoteConnectionError: unable to connect to 127.0.0.1
====================== 2 failed, 2652 passed, 26 skipped, 46 warnings in 38.61s ======================

I have not tried to understand or fix that.

musicinmybrain avatar Jun 14 '25 12:06 musicinmybrain