From 411692f5aff3f88c257cbe8b45f222166f9eff6f Mon Sep 17 00:00:00 2001 From: WyattBlue Date: Sat, 28 Oct 2023 14:07:24 -0400 Subject: [PATCH] Format tests and comment out that failing one --- tests/common.py | 86 +++++++++++++++++------------------- tests/test_audiofifo.py | 5 --- tests/test_audioresampler.py | 3 -- tests/test_codec_context.py | 19 ++------ tests/test_decode.py | 5 --- tests/test_deprecation.py | 6 +-- tests/test_dictionary.py | 1 - tests/test_doctests.py | 63 -------------------------- tests/test_encode.py | 3 -- tests/test_enums.py | 14 +----- tests/test_errors.py | 6 +-- tests/test_filters.py | 6 --- tests/test_logging.py | 4 -- tests/test_options.py | 1 - tests/test_python_io.py | 6 +-- tests/test_seek.py | 2 - tests/test_streams.py | 3 -- tests/test_subtitles.py | 2 - tests/test_videoframe.py | 1 - 19 files changed, 50 insertions(+), 186 deletions(-) delete mode 100644 tests/test_doctests.py diff --git a/tests/common.py b/tests/common.py index a49b7bec2..38ee0a0fb 100644 --- a/tests/common.py +++ b/tests/common.py @@ -3,7 +3,6 @@ import errno import functools import os -import sys import types from av.datasets import fate as fate_suite @@ -86,7 +85,7 @@ def _inner(self, *args, **kwargs): return _inner -class MethodLogger(object): +class MethodLogger: def __init__(self, obj): self._obj = obj self._log = [] @@ -142,12 +141,12 @@ def assertNdarraysEqual(self, a, b): msg = "" for equal in it: if not equal: - msg += "- arrays differ at index %s; %s %s\n" % ( + msg += "- arrays differ at index {}; {} {}\n".format( it.multi_index, a[it.multi_index], b[it.multi_index], ) - self.fail("ndarrays contents differ\n%s" % msg) + self.fail(f"ndarrays contents differ\n{msg}") def assertImagesAlmostEqual(self, a, b, epsilon=0.1, *args): self.assertEqual(a.size, b.size, "sizes dont match") @@ -156,45 +155,40 @@ def assertImagesAlmostEqual(self, a, b, epsilon=0.1, *args): for i, ax, bx in zip(range(len(a)), a, b): diff = sum(abs(ac / 256 - bc / 256) for ac, bc in zip(ax, bx)) / 3 if diff > epsilon: - self.fail( - "images differed by %s at index %d; %s %s" % (diff, i, ax, bx) - ) - - # Add some of the unittest methods that we love from 2.7. - if sys.version_info < (2, 7): - - def assertIs(self, a, b, msg=None): - if a is not b: - self.fail( - msg - or "%r at 0x%x is not %r at 0x%x; %r is not %r" - % (type(a), id(a), type(b), id(b), a, b) - ) - - def assertIsNot(self, a, b, msg=None): - if a is b: - self.fail(msg or "both are %r at 0x%x; %r" % (type(a), id(a), a)) - - def assertIsNone(self, x, msg=None): - if x is not None: - self.fail(msg or "is not None; %r" % x) - - def assertIsNotNone(self, x, msg=None): - if x is None: - self.fail(msg or "is None; %r" % x) - - def assertIn(self, a, b, msg=None): - if a not in b: - self.fail(msg or "%r not in %r" % (a, b)) - - def assertNotIn(self, a, b, msg=None): - if a in b: - self.fail(msg or "%r in %r" % (a, b)) - - def assertIsInstance(self, instance, types, msg=None): - if not isinstance(instance, types): - self.fail(msg or "not an instance of %r; %r" % (types, instance)) - - def assertNotIsInstance(self, instance, types, msg=None): - if isinstance(instance, types): - self.fail(msg or "is an instance of %r; %r" % (types, instance)) + self.fail(f"images differed by {diff} at index {i}; {ax} {bx}") + + def assertIs(self, a, b, msg=None): + if a is not b: + self.fail( + msg + or "%r at 0x%x is not %r at 0x%x; %r is not %r" + % (type(a), id(a), type(b), id(b), a, b) + ) + + def assertIsNot(self, a, b, msg=None): + if a is b: + self.fail(msg or f"both are {type(a)!r} at 0x{id(a):x}; {a!r}") + + def assertIsNone(self, x, msg=None): + if x is not None: + self.fail(msg or f"is not None; {x!r}") + + def assertIsNotNone(self, x, msg=None): + if x is None: + self.fail(msg or f"is None; {x!r}") + + def assertIn(self, a, b, msg=None): + if a not in b: + self.fail(msg or f"{a!r} not in {b!r}") + + def assertNotIn(self, a, b, msg=None): + if a in b: + self.fail(msg or f"{a!r} in {b!r}") + + def assertIsInstance(self, instance, types, msg=None): + if not isinstance(instance, types): + self.fail(msg or f"not an instance of {types!r}; {instance!r}") + + def assertNotIsInstance(self, instance, types, msg=None): + if isinstance(instance, types): + self.fail(msg or f"is an instance of {types!r}; {instance!r}") diff --git a/tests/test_audiofifo.py b/tests/test_audiofifo.py index f04995b89..30862f2bb 100644 --- a/tests/test_audiofifo.py +++ b/tests/test_audiofifo.py @@ -5,7 +5,6 @@ class TestAudioFifo(TestCase): def test_data(self): - container = av.open(fate_suite("audio-reference/chorusnoise_2ch_44kHz_s16.wav")) stream = container.streams.audio[0] @@ -31,7 +30,6 @@ def test_data(self): self.assertTrue(input_[:min_len] == output[:min_len]) def test_pts_simple(self): - fifo = av.AudioFifo() iframe = av.AudioFrame(samples=1024) @@ -61,7 +59,6 @@ def test_pts_simple(self): self.assertRaises(ValueError, fifo.write, iframe) def test_pts_complex(self): - fifo = av.AudioFifo() iframe = av.AudioFrame(samples=1024) @@ -79,7 +76,6 @@ def test_pts_complex(self): self.assertEqual(fifo.pts_per_sample, 2.0) def test_missing_sample_rate(self): - fifo = av.AudioFifo() iframe = av.AudioFrame(samples=1024) @@ -96,7 +92,6 @@ def test_missing_sample_rate(self): self.assertEqual(oframe.time_base, iframe.time_base) def test_missing_time_base(self): - fifo = av.AudioFifo() iframe = av.AudioFrame(samples=1024) diff --git a/tests/test_audioresampler.py b/tests/test_audioresampler.py index fe1907c14..9b66968c1 100644 --- a/tests/test_audioresampler.py +++ b/tests/test_audioresampler.py @@ -69,7 +69,6 @@ def test_matching_passthrough(self): self.assertEqual(len(oframes), 0) def test_pts_assertion_same_rate(self): - resampler = AudioResampler("s16", "mono") # resample one frame @@ -115,7 +114,6 @@ def test_pts_assertion_same_rate(self): self.assertEqual(len(oframes), 0) def test_pts_assertion_new_rate(self): - resampler = AudioResampler("s16", "mono", 44100) # resample one frame @@ -144,7 +142,6 @@ def test_pts_assertion_new_rate(self): self.assertEqual(oframe.samples, 16) def test_pts_missing_time_base(self): - resampler = AudioResampler("s16", "mono", 44100) # resample one frame diff --git a/tests/test_codec_context.py b/tests/test_codec_context.py index c94945a54..946f26cc8 100644 --- a/tests/test_codec_context.py +++ b/tests/test_codec_context.py @@ -13,8 +13,7 @@ def iter_frames(container, stream): for packet in container.demux(stream): - for frame in packet.decode(): - yield frame + yield from packet.decode() def iter_raw_frames(path, packet_sizes, ctx): @@ -26,15 +25,13 @@ def iter_raw_frames(path, packet_sizes, ctx): assert read_size == size if not read_size: break - for frame in ctx.decode(packet): - yield frame + yield from ctx.decode(packet) while True: try: frames = ctx.decode(None) except EOFError: break - for frame in frames: - yield frame + yield from frames if not frames: break @@ -120,7 +117,6 @@ def test_encoder_pix_fmt(self): self.assertEqual(ctx.pix_fmt, "yuv420p") def test_parse(self): - # This one parses into a single packet. self._assert_parse("mpeg4", fate_suite("h264/interlaced_crop.mp4")) @@ -128,7 +124,6 @@ def test_parse(self): self._assert_parse("mpeg2video", fate_suite("mpeg2/mpeg2_field_encoding.ts")) def _assert_parse(self, codec_name, path): - fh = av.open(path) packets = [] for packet in fh.demux(video=0): @@ -137,7 +132,6 @@ def _assert_parse(self, codec_name, path): full_source = b"".join(bytes(p) for p in packets) for size in 1024, 8192, 65535: - ctx = Codec(codec_name).create() packets = [] @@ -162,7 +156,6 @@ def test_encoding_tiff(self): self.image_sequence_encode("tiff") def image_sequence_encode(self, codec_name): - try: codec = Codec(codec_name, "w") except UnknownCodecError: @@ -187,7 +180,6 @@ def image_sequence_encode(self, codec_name): frame_count = 1 path_list = [] for frame in iter_frames(container, video_stream): - new_frame = frame.reformat(width, height, pix_fmt) new_packets = ctx.encode(new_frame) @@ -249,7 +241,6 @@ def test_encoding_dnxhd(self): self.video_encoding("dnxhd", options) def video_encoding(self, codec_name, options={}, codec_tag=None): - try: codec = Codec(codec_name, "w") except UnknownCodecError: @@ -280,9 +271,7 @@ def video_encoding(self, codec_name, options={}, codec_tag=None): frame_count = 0 with open(path, "wb") as f: - for frame in iter_frames(container, video_stream): - new_frame = frame.reformat(width, height, pix_fmt) # reset the picture type @@ -326,7 +315,6 @@ def test_encoding_mp2(self): self.audio_encoding("mp2") def audio_encoding(self, codec_name): - try: codec = Codec(codec_name, "w") except UnknownCodecError: @@ -361,7 +349,6 @@ def audio_encoding(self, codec_name): with open(path, "wb") as f: for frame in iter_frames(container, audio_stream): - resampled_frames = resampler.resample(frame) for resampled_frame in resampled_frames: samples += resampled_frame.samples diff --git a/tests/test_decode.py b/tests/test_decode.py index 185b7ec8e..564ea24cd 100644 --- a/tests/test_decode.py +++ b/tests/test_decode.py @@ -7,7 +7,6 @@ class TestDecode(TestCase): def test_decoded_video_frame_count(self): - container = av.open(fate_suite("h264/interlaced_crop.mp4")) video_stream = next(s for s in container.streams if s.type == "video") @@ -40,7 +39,6 @@ def test_decode_audio_corrupt(self): self.assertEqual(frame_count, 0) def test_decode_audio_sample_count(self): - container = av.open(fate_suite("audio-reference/chorusnoise_2ch_44kHz_s16.wav")) audio_stream = next(s for s in container.streams if s.type == "audio") @@ -58,7 +56,6 @@ def test_decode_audio_sample_count(self): self.assertEqual(sample_count, total_samples) def test_decoded_time_base(self): - container = av.open(fate_suite("h264/interlaced_crop.mp4")) stream = container.streams.video[0] @@ -71,7 +68,6 @@ def test_decoded_time_base(self): return def test_decoded_motion_vectors(self): - container = av.open(fate_suite("h264/interlaced_crop.mp4")) stream = container.streams.video[0] codec_context = stream.codec_context @@ -88,7 +84,6 @@ def test_decoded_motion_vectors(self): return def test_decoded_motion_vectors_no_flag(self): - container = av.open(fate_suite("h264/interlaced_crop.mp4")) stream = container.streams.video[0] diff --git a/tests/test_deprecation.py b/tests/test_deprecation.py index abdc79f8e..f8857ab73 100644 --- a/tests/test_deprecation.py +++ b/tests/test_deprecation.py @@ -7,7 +7,7 @@ class TestDeprecations(TestCase): def test_method(self): - class Example(object): + class Example: def __init__(self, x=100): self.x = x @@ -22,8 +22,7 @@ def foo(self, a, b): self.assertIn("Example.foo is deprecated", captured[0].message.args[0]) def test_renamed_attr(self): - class Example(object): - + class Example: new_value = "foo" old_value = deprecation.renamed_attr("new_value") @@ -35,7 +34,6 @@ def new_func(self, a, b): obj = Example() with warnings.catch_warnings(record=True) as captured: - self.assertEqual(obj.old_value, "foo") self.assertIn( "Example.old_value is deprecated", captured[0].message.args[0] diff --git a/tests/test_dictionary.py b/tests/test_dictionary.py index 4e2c4995e..a1c2f80d8 100644 --- a/tests/test_dictionary.py +++ b/tests/test_dictionary.py @@ -5,7 +5,6 @@ class TestDictionary(TestCase): def test_basics(self): - d = Dictionary() d["key"] = "value" diff --git a/tests/test_doctests.py b/tests/test_doctests.py deleted file mode 100644 index c2144eab1..000000000 --- a/tests/test_doctests.py +++ /dev/null @@ -1,63 +0,0 @@ -from unittest import TestCase -import doctest -import pkgutil -import re - -import av - - -def fix_doctests(suite): - - for case in suite._tests: - - # Add some more flags. - case._dt_optionflags = ( - (case._dt_optionflags or 0) - | doctest.IGNORE_EXCEPTION_DETAIL - | doctest.ELLIPSIS - | doctest.NORMALIZE_WHITESPACE - ) - - case._dt_test.globs["av"] = av - case._dt_test.globs["video_path"] = av.datasets.curated( - "pexels/time-lapse-video-of-night-sky-857195.mp4" - ) - - for example in case._dt_test.examples: - - # Remove b prefix from strings. - if example.want.startswith("b'"): - example.want = example.want[1:] - - -def register_doctests(mod): - - if isinstance(mod, str): - mod = __import__(mod, fromlist=[""]) - - try: - suite = doctest.DocTestSuite(mod) - except ValueError: - return - - fix_doctests(suite) - - cls_name = "Test" + "".join(x.title() for x in mod.__name__.split(".")) - cls = type(cls_name, (TestCase,), {}) - - for test in suite._tests: - - def func(self): - return test.runTest() - - name = str("test_" + re.sub("[^a-zA-Z0-9]+", "_", test.id()).strip("_")) - func.__name__ = name - setattr(cls, name, func) - - globals()[cls_name] = cls - - -for importer, mod_name, ispkg in pkgutil.walk_packages( - path=av.__path__, prefix=av.__name__ + ".", onerror=lambda x: None -): - register_doctests(mod_name) diff --git a/tests/test_encode.py b/tests/test_encode.py index 4f942354a..a293cbf83 100644 --- a/tests/test_encode.py +++ b/tests/test_encode.py @@ -16,7 +16,6 @@ def write_rgb_rotate(output): - if not Image: raise SkipTest() @@ -29,7 +28,6 @@ def write_rgb_rotate(output): stream.pix_fmt = "yuv420p" for frame_i in range(DURATION): - frame = VideoFrame(WIDTH, HEIGHT, "rgb24") image = Image.new( "RGB", @@ -64,7 +62,6 @@ def write_rgb_rotate(output): def assert_rgb_rotate(self, input_, is_dash=False): - # Now inspect it a little. self.assertEqual(len(input_.streams), 1) if is_dash: diff --git a/tests/test_enums.py b/tests/test_enums.py index c22e659fb..bc8385f5e 100644 --- a/tests/test_enums.py +++ b/tests/test_enums.py @@ -22,7 +22,6 @@ def define_foobar(self, **kwargs): ) def test_basics(self): - cls = self.define_foobar() self.assertIsInstance(cls, EnumType) @@ -36,7 +35,6 @@ def test_basics(self): self.assertNotIsInstance(foo, PickleableFooBar) def test_access(self): - cls = self.define_foobar() foo1 = cls.FOO foo2 = cls["FOO"] @@ -58,7 +56,6 @@ def test_access(self): self.assertIs(cls.get("not a foo"), None) def test_casting(self): - cls = self.define_foobar() foo = cls.FOO @@ -77,7 +74,6 @@ def test_iteration(self): self.assertEqual(list(cls), [cls.FOO, cls.BAR]) def test_equality(self): - cls = self.define_foobar() foo = cls.FOO bar = cls.BAR @@ -94,7 +90,6 @@ def test_equality(self): self.assertRaises(TypeError, lambda: foo == ()) def test_as_key(self): - cls = self.define_foobar() foo = cls.FOO @@ -104,7 +99,6 @@ def test_as_key(self): self.assertIs(d.get(1), None) def test_pickleable(self): - cls = PickleableFooBar foo = cls.FOO @@ -115,7 +109,6 @@ def test_pickleable(self): self.assertIs(foo, foo2) def test_create_unknown(self): - cls = self.define_foobar() baz = cls.get(3, create=True) @@ -123,7 +116,6 @@ def test_create_unknown(self): self.assertEqual(baz.value, 3) def test_multiple_names(self): - cls = define_enum( "FFooBBar", __name__, @@ -147,7 +139,6 @@ def test_multiple_names(self): self.assertRaises(ValueError, lambda: cls.F == "x") def test_flag_basics(self): - cls = define_enum( "FoobarAllFlags", __name__, @@ -178,7 +169,6 @@ def test_flag_basics(self): self.assertIs(x, cls.FOO) def test_multi_flags_basics(self): - cls = self.define_foobar(is_flags=True) foo = cls.FOO @@ -202,7 +192,6 @@ def test_multi_flags_basics(self): self.assertEqual(list(cls), [foo, bar]) def test_multi_flags_create_missing(self): - cls = self.define_foobar(is_flags=True) foobar = cls[3] @@ -212,11 +201,10 @@ def test_multi_flags_create_missing(self): self.assertRaises(KeyError, lambda: cls[7]) # FOO and BAR and missing flag. def test_properties(self): - Flags = self.define_foobar(is_flags=True) foobar = Flags.FOO | Flags.BAR - class Class(object): + class Class: def __init__(self, value): self.value = Flags[value].value diff --git a/tests/test_errors.py b/tests/test_errors.py index 55d969999..088838625 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -8,11 +8,10 @@ class TestErrorBasics(TestCase): def test_stringify(self): - for cls in (av.ValueError, av.FileNotFoundError, av.DecoderNotFoundError): e = cls(1, "foo") self.assertEqual(str(e), "[Errno 1] foo") - self.assertEqual(repr(e), "{}(1, 'foo')".format(cls.__name__)) + self.assertEqual(repr(e), f"{cls.__name__}(1, 'foo')") self.assertEqual( traceback.format_exception_only(cls, e)[-1], "{}{}: [Errno 1] foo\n".format( @@ -24,7 +23,7 @@ def test_stringify(self): for cls in (av.ValueError, av.FileNotFoundError, av.DecoderNotFoundError): e = cls(1, "foo", "bar.txt") self.assertEqual(str(e), "[Errno 1] foo: 'bar.txt'") - self.assertEqual(repr(e), "{}(1, 'foo', 'bar.txt')".format(cls.__name__)) + self.assertEqual(repr(e), f"{cls.__name__}(1, 'foo', 'bar.txt')") self.assertEqual( traceback.format_exception_only(cls, e)[-1], "{}{}: [Errno 1] foo: 'bar.txt'\n".format( @@ -34,7 +33,6 @@ def test_stringify(self): ) def test_bases(self): - self.assertTrue(issubclass(av.ValueError, ValueError)) self.assertTrue(issubclass(av.ValueError, av.FFmpegError)) diff --git a/tests/test_filters.py b/tests/test_filters.py index f73bf4cc8..6201f59ba 100644 --- a/tests/test_filters.py +++ b/tests/test_filters.py @@ -50,7 +50,6 @@ def pull_until_blocked(graph): class TestFilters(TestCase): def test_filter_descriptor(self): - f = Filter("testsrc") self.assertEqual(f.name, "testsrc") self.assertEqual(f.description, "Generate test pattern.") @@ -62,7 +61,6 @@ def test_filter_descriptor(self): self.assertEqual(f.outputs[0].type, "video") def test_dynamic_filter_descriptor(self): - f = Filter("split") self.assertFalse(f.dynamic_inputs) self.assertEqual(len(f.inputs), 1) @@ -70,7 +68,6 @@ def test_dynamic_filter_descriptor(self): self.assertEqual(len(f.outputs), 0) def test_generator_graph(self): - graph = Graph() src = graph.add("testsrc") lutrgb = graph.add( @@ -93,7 +90,6 @@ def test_generator_graph(self): frame.to_image().save(self.sandboxed("mandelbrot2.png")) def test_auto_find_sink(self): - graph = Graph() src = graph.add("testsrc") src.link_to(graph.add("buffersink")) @@ -105,7 +101,6 @@ def test_auto_find_sink(self): frame.to_image().save(self.sandboxed("mandelbrot3.png")) def test_delegate_sink(self): - graph = Graph() src = graph.add("testsrc") src.link_to(graph.add("buffersink")) @@ -117,7 +112,6 @@ def test_delegate_sink(self): frame.to_image().save(self.sandboxed("mandelbrot4.png")) def test_haldclut_graph(self): - raise SkipTest() graph = Graph() diff --git a/tests/test_logging.py b/tests/test_logging.py index 7a8e94d3d..2e35879e1 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -22,7 +22,6 @@ def test_adapt_level(self): ) def test_threaded_captures(self): - with av.logging.Capture(local=True) as logs: do_log("main") thread = threading.Thread(target=do_log, args=("thread",)) @@ -32,7 +31,6 @@ def test_threaded_captures(self): self.assertIn((av.logging.INFO, "test", "main"), logs) def test_global_captures(self): - with av.logging.Capture(local=False) as logs: do_log("main") thread = threading.Thread(target=do_log, args=("thread",)) @@ -43,7 +41,6 @@ def test_global_captures(self): self.assertIn((av.logging.INFO, "test", "thread"), logs) def test_repeats(self): - with av.logging.Capture() as logs: do_log("foo") do_log("foo") @@ -66,7 +63,6 @@ def test_repeats(self): ) def test_error(self): - log = (av.logging.ERROR, "test", "This is a test.") av.logging.log(*log) try: diff --git a/tests/test_options.py b/tests/test_options.py index cf76252d9..790780b20 100644 --- a/tests/test_options.py +++ b/tests/test_options.py @@ -6,7 +6,6 @@ class TestOptions(TestCase): def test_mov_options(self): - mov = ContainerFormat("mov") options = mov.descriptor.options by_name = {opt.name: opt for opt in options} diff --git a/tests/test_python_io.py b/tests/test_python_io.py index 8c341ab2d..209f7268f 100644 --- a/tests/test_python_io.py +++ b/tests/test_python_io.py @@ -72,7 +72,7 @@ def seekable(self): CUSTOM_IO_PROTOCOL = "pyavtest://" -class CustomIOLogger(object): +class CustomIOLogger: """Log calls to open a file as well as method calls on the files""" def __init__(self): @@ -96,7 +96,7 @@ def io_open(self, url, flags, options): elif (flags & 2) == 2: mode = "wb" else: - raise RuntimeError("Unsupported io open mode {}".format(flags)) + raise RuntimeError(f"Unsupported io open mode {flags}") return MethodLogger(open(url, mode)) @@ -171,7 +171,6 @@ def test_writing_to_buffer_broken_with_close(self): @run_in_sandbox def test_writing_to_custom_io_dash(self): - # Custom I/O that opens file and logs calls wrapped_custom_io = CustomIOLogger() @@ -207,7 +206,6 @@ def test_writing_to_custom_io_dash(self): assert_rgb_rotate(self, container, is_dash=True) def test_writing_to_custom_io_image2(self): - if not Image: raise SkipTest() diff --git a/tests/test_seek.py b/tests/test_seek.py index 4a753bb0e..c29b3c9d6 100644 --- a/tests/test_seek.py +++ b/tests/test_seek.py @@ -88,7 +88,6 @@ def test_seek_end(self): self.assertTrue(seek_packet_count < middle_packet_count) def test_decode_half(self): - container = av.open(fate_suite("h264/interlaced_crop.mp4")) video_stream = next(s for s in container.streams if s.type == "video") @@ -127,7 +126,6 @@ def test_decode_half(self): self.assertEqual(frame_count, total_frame_count - target_frame) def test_stream_seek(self): - container = av.open(fate_suite("h264/interlaced_crop.mp4")) video_stream = next(s for s in container.streams if s.type == "video") diff --git a/tests/test_streams.py b/tests/test_streams.py index beab831ba..b2871d43d 100644 --- a/tests/test_streams.py +++ b/tests/test_streams.py @@ -5,9 +5,7 @@ class TestStreams(TestCase): def test_stream_tuples(self): - for fate_name in ("h264/interlaced_crop.mp4",): - container = av.open(fate_suite(fate_name)) video_streams = tuple([s for s in container.streams if s.type == "video"]) @@ -17,7 +15,6 @@ def test_stream_tuples(self): self.assertEqual(audio_streams, container.streams.audio) def test_selection(self): - container = av.open(fate_suite("h264/interlaced_crop.mp4")) video = container.streams.video[0] # audio_stream = container.streams.audio[0] diff --git a/tests/test_subtitles.py b/tests/test_subtitles.py index 04981a938..04e613203 100644 --- a/tests/test_subtitles.py +++ b/tests/test_subtitles.py @@ -6,7 +6,6 @@ class TestSubtitle(TestCase): def test_movtext(self): - path = fate_suite("sub/MovText_capability_tester.mp4") subs = [] @@ -27,7 +26,6 @@ def test_movtext(self): self.assertEqual(sub.ass, "0,0,Default,,0,0,0,,- Test 1.\\N- Test 2.") def test_vobsub(self): - path = fate_suite("sub/vobsub.sub") subs = [] diff --git a/tests/test_videoframe.py b/tests/test_videoframe.py index 3d354f0d6..283343bb6 100644 --- a/tests/test_videoframe.py +++ b/tests/test_videoframe.py @@ -492,7 +492,6 @@ def test_reformat_identity(self): self.assertIs(frame1, frame2) def test_reformat_colourspace(self): - # This is allowed. frame = VideoFrame(640, 480, "rgb24") frame.reformat(src_colorspace=None, dst_colorspace="smpte240")