From 74e994ef778573561941c0e310dd992353d73f7e Mon Sep 17 00:00:00 2001 From: Christian Stadelmann Date: Sun, 30 Jul 2023 20:10:02 +0200 Subject: [PATCH] chore: fix some pytest warnings See also: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose --- tests/xl/trax/test_search.py | 10 +++++----- tests/xl/trax/test_track.py | 2 +- tests/xl/trax/test_util.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/xl/trax/test_search.py b/tests/xl/trax/test_search.py index 8a3e465dd..0df80cce3 100644 --- a/tests/xl/trax/test_search.py +++ b/tests/xl/trax/test_search.py @@ -19,7 +19,7 @@ def get_search_result_track(): class TestMatcher: - def setup(self): + def setup_method(self): self.strack = get_search_result_track() self.strack.track.set_tag_raw('artist', ['foo', 'bar']) @@ -54,7 +54,7 @@ def test_matches(self): class TestExactMatcher: - def setup(self): + def setup_method(self): self.str = get_search_result_track() def test_exact_matcher_true(self): @@ -69,7 +69,7 @@ def test_exact_matcher_false(self): class TestInMatcher: - def setup(self): + def setup_method(self): self.str = get_search_result_track() def test_in_matcher_none(self): @@ -94,7 +94,7 @@ def test_in_matcher_false(self): class TestGtLtMatchers: - def setup(self): + def setup_method(self): self.str = get_search_result_track() def test_gt_bitrate_matcher_true(self): @@ -197,7 +197,7 @@ def test_false(self): class TestTracksMatcher: - def setup(self): + def setup_method(self): self.str = get_search_result_track() def test_in_matcher(self): diff --git a/tests/xl/trax/test_track.py b/tests/xl/trax/test_track.py index 1602dbaef..ee2b60496 100644 --- a/tests/xl/trax/test_track.py +++ b/tests/xl/trax/test_track.py @@ -21,7 +21,7 @@ class Test_MetadataCacher: TIMEOUT = 2000 MAX_ENTRIES = 2 - def setup(self): + def setup_method(self): self.mc: track._MetadataCacher[str, str] = track._MetadataCacher( self.TIMEOUT, self.MAX_ENTRIES ) diff --git a/tests/xl/trax/test_util.py b/tests/xl/trax/test_util.py index 9b1e45d24..2a21254ae 100644 --- a/tests/xl/trax/test_util.py +++ b/tests/xl/trax/test_util.py @@ -41,7 +41,7 @@ def test_directory(self): class TestSortTracks: - def setup(self): + def setup_method(self): self.tracks = [ xl.trax.track.Track(url) for url in ('/tmp/foo', '/tmp/bar', '/tmp/baz') ] @@ -62,7 +62,7 @@ def test_reversed(self): class TestSortResultTracks: - def setup(self): + def setup_method(self): tracks = [ xl.trax.track.Track(url) for url in ('/tmp/foo', '/tmp/bar', '/tmp/baz') ]