diff options
| author | 2025-08-16 07:00:33 -0400 | |
|---|---|---|
| committer | 2025-08-16 07:00:33 -0400 | |
| commit | 3d18761f620a294ea6c5bff13c5994b93b29f3ed (patch) | |
| tree | 092fa6f8128bc187512be532801670417f215986 /test/test_extractor.py | |
| parent | a6e995c093de8aae2e91a0787281bb34c0b871eb (diff) | |
New upstream version 1.30.3.upstream/1.30.3
Diffstat (limited to 'test/test_extractor.py')
| -rw-r--r-- | test/test_extractor.py | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/test/test_extractor.py b/test/test_extractor.py index bf4aa07..f8b8f09 100644 --- a/test/test_extractor.py +++ b/test/test_extractor.py @@ -110,7 +110,7 @@ class TestExtractorModule(unittest.TestCase): except AssertionError: pass else: - self.fail(result["#url"] + ": Test did not fail") + self.fail(f"{result['#url']}: Test did not fail") else: self.assertCategories(result) @@ -167,8 +167,7 @@ class TestExtractorModule(unittest.TestCase): extr.finalize() except ImportError as exc: if exc.name in ("youtube_dl", "yt_dlp"): - raise unittest.SkipTest("cannot import module '{}'".format( - exc.name)) + raise unittest.SkipTest(f"cannot import module '{exc.name}'") raise def test_docstrings(self): @@ -179,7 +178,7 @@ class TestExtractorModule(unittest.TestCase): self.assertNotEqual( extr1.__doc__, extr2.__doc__, - "{} <-> {}".format(extr1, extr2), + f"{extr1} <-> {extr2}", ) def test_names(self): @@ -191,12 +190,10 @@ class TestExtractorModule(unittest.TestCase): for extr in extractor.extractors(): if extr.category not in ("", "oauth", "ytdl"): - expected = "{}{}Extractor".format( - capitalize(extr.category), - capitalize(extr.subcategory), - ) + expected = (f"{capitalize(extr.category)}" + f"{capitalize(extr.subcategory)}Extractor") if expected[0].isdigit(): - expected = "_" + expected + expected = f"_{expected}" self.assertEqual(expected, extr.__name__) @@ -225,7 +222,7 @@ class TestExtractorWait(unittest.TestCase): calls = sleep.mock_calls self.assertEqual(len(calls), 1) - self.assertAlmostEqual(calls[0][1][0], 6.0, places=1) + self.assertAlmostEqual(calls[0][1][0], 6.0, places=0) calls = log.info.mock_calls self.assertEqual(len(calls), 1) @@ -266,7 +263,7 @@ class TextExtractorOAuth(unittest.TestCase): def test_oauth1(self): for category in ("flickr", "smugmug", "tumblr"): - extr = extractor.find("oauth:" + category) + extr = extractor.find(f"oauth:{category}") with patch.object(extr, "_oauth1_authorization_flow") as m: for msg in extr: @@ -275,7 +272,7 @@ class TextExtractorOAuth(unittest.TestCase): def test_oauth2(self): for category in ("deviantart", "reddit"): - extr = extractor.find("oauth:" + category) + extr = extractor.find(f"oauth:{category}") with patch.object(extr, "_oauth2_authorization_code_grant") as m: for msg in extr: |
