pyfilesystem2
pyfilesystem2 copied to clipboard
Make tests compatible with pyftpdlib 2.0
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
pyftpdlibtest dependency from~=1.5to~=2.0 - Uses
pyftpdlib’stestextra (introduced in 2.0) to bring in dependencies forpyftpdlib.test, rather than naming them and maintaining their version bounds manually. - Follow the renaming of
ThreadedTestFTPdtoFtpdThreadWrapper
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.