[tests] add support for skipping an extractor result test

This commit is contained in:
Mike Fährmann
2025-03-12 16:41:46 +01:00
parent e1bdcd97e1
commit d40f8a82be
2 changed files with 5 additions and 0 deletions

View File

@@ -372,6 +372,7 @@ __tests__ = (
{ {
"#url" : "https://sankaku.app/post/show/20758561", "#url" : "https://sankaku.app/post/show/20758561",
"#comment" : "empty tags (#1617)", "#comment" : "empty tags (#1617)",
"#skip" : "legacy, now unsupported, numerical post ID",
"#category": ("booru", "sankaku", "post"), "#category": ("booru", "sankaku", "post"),
"#class" : sankaku.SankakuPostExtractor, "#class" : sankaku.SankakuPostExtractor,
"#options" : {"tags": True}, "#options" : {"tags": True},

View File

@@ -106,6 +106,10 @@ class TestExtractorResults(unittest.TestCase):
if len(result) <= 2: if len(result) <= 2:
return # only matching return # only matching
skip = result.pop("#skip", False)
if skip:
return self._skipped.append((result["#url"], skip))
if auth is None: if auth is None:
auth = (cat in AUTH_REQUIRED) auth = (cat in AUTH_REQUIRED)
elif not auth: elif not auth: