Simplifying pytest markers/skip conditions for "no internet"
See original GitHub issueI’m trying to enable test runs in the conda-forge builds of this package, but I’m finding it hard to get the implementation right.
One of the reasons for this is that this package implements a way to check for internet access which is a bit unusual for a framework based on pytest. As far as I could understand, if the value of the environment variable IMAGEIO_NO_INTERNET
assumes a true value, then certain tests should be skipped. This in turn is used inside imageio/testing.py
to issue a pytest.skip("No internet")
within a function called need_internet()
, which is in turned used within each test inside tests/
, which would require internet access otherwise.
Would it be possible to consider a simplification of this testing in which, instead of this system, you mark the tests that require internet with something like:
@pytest.mark.requires_internet
def test_bla():
...
Then, you select tests with or without internet access with:
$ pytest -m "requires_internet" ... # all tests that require internet
$ pytest -m "not requires_internet" ... # all tests that do not require internet
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (8 by maintainers)
Top GitHub Comments
This probably relates to my own ignorance on how to maintain this package - looking at the
ci.yaml
file, I got under the impression thatinvoke
was required. This seems to work, if ffmpeg and iomage-ffmpeg are not installed:Please ignore that point.
OK.
Fair enough - I’ll leave this bit to you then.
Yes we still do that. If you think it is still relevant do have them, then lets keep them around.
That’s a valid point; I didn’t think about that at all. This is indeed enough reason to keep a switch like this around.