fatiando / pooch

A friend to fetch your data files
https://www.fatiando.org/pooch
Other
630 stars 76 forks source link

Mark additional tests requiring network #412

Closed penguinpee closed 6 months ago

penguinpee commented 6 months ago

Those tests also require network and should be excluded when running pytest -m 'not network'.

Summary for Squash and Merge

Add network pytest mark to test functions that require network connection to hit third party servers. Improve test_check_availability_invalid_downloader to remove the need to use network connection just to test an error raised after an invalid argument to a custom downloader.

welcome[bot] commented 6 months ago

💖 Thank you for opening your first pull request in this repository! 💖

A few things to keep in mind:

No matter what, we are really grateful that you put in the effort to do this!

penguinpee commented 6 months ago

Background: In Fedora the build environment is not network enabled and downloads are prohibited during build. Yet, we like to run tests whenever possible. This allows us to simply pass -m 'no network' to pytest for running all tests that don't require network.

penguinpee commented 6 months ago

I marked a few more tests, which I discovered being unmarked after updating to the latest release.

penguinpee commented 6 months ago

In a nutshell, I'll make sure all plugins are present and will test again. I suppose you are right regarding the tests relying on localftpserver and httpserver. I'll update this PR according to my findings. Apologies for being a bit hasty in my conclusions.

penguinpee commented 6 months ago

This now works for me with httpserver and localftpserver using `-m 'not network'.

welcome[bot] commented 6 months ago

🎉 Congrats on merging your first pull request and welcome to the team! 🎉

If you would like to be added as a author on the Zenodo archive of the next release, add your full name, affiliation, and ORCID (optional) to the AUTHORS.md file of this repository. Feel free to do this in a new pull request if needed.

We hope that this was a good experience for you. Let us know if there is any way that the contributing process could be improved.