Skip to content

Allow disabling tests that require network access #955

@mweinelt

Description

@mweinelt

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis is similar to an existing issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions