Repository: PyAV-Org/PyAV

Issue #623: testsuite require network access by default
Created: 2020-04-16T13:20:49Z
The test file tests/test_doctests.py fails in a build environment without network access.
Some build environments - including Debian autobuilders - explicitly disable network to make builds more deterministic.
Please rely on network access only optionally.
One elegant way to do that is to borrow the logic used in Perl: Check environment variable EXTENDED_TESTING and if not set to a non-empty value then skip all such "extended testing".
Thanks for considering.

Duplicate issue #955: Allow disabling tests that require network access
Created: 2022-04-06T15:38:42Z
Overview
We are packaging PyAV for NixOS and to verify our integration works out we run the test suite. Since our builds are sandboxed and have no network access, a large part of the test suite fails, because it wants to download data from FATE. Those tests errror out with
>               raise URLError(err)
E               urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name resolution>

Desired Behavior
It would help us alot if those these were using pytest.mark to signal they were requiring network access. That would mean decorating those tests with @pytest.mark.network
Registering custom markers
https://docs.pytest.org/en/6.2.x/mark.html#registering-marks
Using markers
https://docs.pytest.org/en/6.2.x/example/markers.html
Example API
pytest -m "not network"

Additional context
FAILED tests/test_audiofifo.py::TestAudioFifo::test_data - urllib.error.URLEr...
FAILED tests/test_codec_context.py::TestCodecContext::test_codec_tag - urllib...
FAILED tests/test_codec_context.py::TestCodecContext::test_parse - urllib.err...
FAILED tests/test_codec_context.py::TestEncoding::test_encoding_aac - urllib....
FAILED tests/test_codec_context.py::TestEncoding::test_encoding_dnxhd - urlli...
FAILED tests/test_codec_context.py::TestEncoding::test_encoding_dvvideo - url...
FAILED tests/test_codec_context.py::TestEncoding::test_encoding_h264 - urllib...
FAILED tests/test_codec_context.py::TestEncoding::test_encoding_mjpeg - urlli...
FAILED tests/test_codec_context.py::TestEncoding::test_encoding_mp2 - urllib....
FAILED tests/test_codec_context.py::TestEncoding::test_encoding_mpeg1video - ...
FAILED tests/test_codec_context.py::TestEncoding::test_encoding_mpeg4 - urlli...
FAILED tests/test_codec_context.py::TestEncoding::test_encoding_pcm_s24le - u...
FAILED tests/test_codec_context.py::TestEncoding::test_encoding_png - urllib....
FAILED tests/test_codec_context.py::TestEncoding::test_encoding_tiff - urllib...
FAILED tests/test_codec_context.py::TestEncoding::test_encoding_xvid - urllib...
FAILED tests/test_decode.py::TestDecode::test_decode_audio_sample_count - url...
FAILED tests/test_decode.py::TestDecode::test_decoded_motion_vectors - urllib...
FAILED tests/test_decode.py::TestDecode::test_decoded_motion_vectors_no_flag
FAILED tests/test_decode.py::TestDecode::test_decoded_time_base - urllib.erro...
FAILED tests/test_decode.py::TestDecode::test_decoded_video_frame_count - url...
FAILED tests/test_encode.py::TestBasicAudioEncoding::test_transcode - urllib....
FAILED tests/test_file_probing.py::TestAudioProbe::test_container_probing - u...
FAILED tests/test_file_probing.py::TestAudioProbe::test_stream_probing - urll...
FAILED tests/test_file_probing.py::TestDataProbe::test_container_probing - ur...
FAILED tests/test_file_probing.py::TestDataProbe::test_stream_probing - urlli...
FAILED tests/test_file_probing.py::TestSubtitleProbe::test_container_probing
FAILED tests/test_file_probing.py::TestSubtitleProbe::test_stream_probing - u...
FAILED tests/test_file_probing.py::TestVideoProbe::test_container_probing - u...
FAILED tests/test_file_probing.py::TestVideoProbe::test_stream_probing - urll...
FAILED tests/test_python_io.py::TestPythonIO::test_reading_from_buffer - urll...
FAILED tests/test_python_io.py::TestPythonIO::test_reading_from_buffer_no_seek
FAILED tests/test_python_io.py::TestPythonIO::test_reading_from_file - urllib...
FAILED tests/test_python_io.py::TestPythonIO::test_reading_from_pipe_readonly
FAILED tests/test_python_io.py::TestPythonIO::test_reading_from_write_readonly
FAILED tests/test_seek.py::TestSeek::test_decode_half - urllib.error.URLError...
FAILED tests/test_seek.py::TestSeek::test_seek_end - urllib.error.URLError: <...
FAILED tests/test_seek.py::TestSeek::test_seek_float - urllib.error.URLError:...
FAILED tests/test_seek.py::TestSeek::test_seek_int64 - urllib.error.URLError:...
FAILED tests/test_seek.py::TestSeek::test_seek_middle - urllib.error.URLError...
FAILED tests/test_seek.py::TestSeek::test_seek_start - urllib.error.URLError:...
FAILED tests/test_seek.py::TestSeek::test_stream_seek - urllib.error.URLError...
FAILED tests/test_streams.py::TestStreams::test_selection - urllib.error.URLE...
FAILED tests/test_streams.py::TestStreams::test_stream_tuples - urllib.error....
FAILED tests/test_subtitles.py::TestSubtitle::test_movtext - urllib.error.URL...
FAILED tests/test_subtitles.py::TestSubtitle::test_vobsub - urllib.error.URLE...
FAILED tests/test_videoframe.py::TestVideoFrameImage::test_roundtrip - urllib...

Closing comment (2022-04-06T15:54:39Z): Duplicate of #623