pynwb
pynwb copied to clipboard
[Feature]: a way to disable all tests requiring dynamic downloads OR a static archive for test data
What would you like to see added to PyNWB?
One of the tests ( tests/read_dandi/test_read_dandi.py::TestReadNWBDandisets::test_read_first_nwb_asset
) fails in a network sandbox.
Here is the full build log ( https://ppb.chymera.eu/4949b9.log ) but I think it's pretty clear what the issue is.
Is your feature request related to a problem?
No response
What solution would you like?
In case there will be more tests requiring network connectivity it would be great to either have an option to disable them globally (so they don't have to be explicitly listed subject to change etc.) or to have a static test data archive the checksum of which can be recorded.
Do you have any interest in helping implement the feature?
Yes, but I would need guidance.
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
- [X] Have you checked the Contributing document?
- [X] Have you ensured this change was not already requested?
disable them globally
How do other packages handle this? Would it be sufficient to check for an environment variable, e.g., PYNWB_NO_NETWORK_TESTS=1
?
@rly yes, that's how most packages do this.
I actually prefer to use pytest markers for different properties of tests, see https://docs.pytest.org/en/6.2.x/example/markers.html#mark-run.
In the ros3
tests we use the following check to detect whether network (and ros3) are available to automatically skip the test.
https://github.com/NeurodataWithoutBorders/pynwb/blob/87a7c578e806f3679fc7b8c5e9777f382406db6a/tests/integration/ros3/test_ros3.py#L21C1-L27
We could do the same here.