aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_results.py9
-rw-r--r--test/test_text.py6
2 files changed, 11 insertions, 4 deletions
diff --git a/test/test_results.py b/test/test_results.py
index c3b9b2d..3136743 100644
--- a/test/test_results.py
+++ b/test/test_results.py
@@ -106,6 +106,10 @@ class TestExtractorResults(unittest.TestCase):
if len(result) <= 2:
return # only matching
+ skip = result.pop("#skip", False)
+ if skip:
+ return self._skipped.append((result["#url"], skip))
+
if auth is None:
auth = (cat in AUTH_REQUIRED)
elif not auth:
@@ -237,7 +241,10 @@ class TestExtractorResults(unittest.TestCase):
elif isinstance(test, range):
self.assertRange(value, test, msg=path)
elif isinstance(test, set):
- self.assertTrue(value in test or type(value) in test, msg=path)
+ try:
+ self.assertIn(value, test, msg=path)
+ except AssertionError:
+ self.assertIn(type(value), test, msg=path)
elif isinstance(test, list):
subtest = False
for idx, item in enumerate(test):
diff --git a/test/test_text.py b/test/test_text.py
index 30feefc..d42507c 100644
--- a/test/test_text.py
+++ b/test/test_text.py
@@ -431,10 +431,10 @@ class TestText(unittest.TestCase):
self.assertEqual(f("foo=1&bar&baz=3"), {"foo": "1", "baz": "3"})
# keys with identical names
- self.assertEqual(f("foo=1&foo=2"), {"foo": ["1", "2"]})
+ self.assertEqual(f("foo=1&foo=2", ("foo",)), {"foo": ["1", "2"]})
self.assertEqual(
- f("foo=1&bar=2&foo=3&bar=4&foo=5"),
- {"foo": ["1", "3", "5"], "bar": ["2", "4"]},
+ f("foo=1&bar=2&foo=3&bar=4&foo=5", {"foo", "baz"}),
+ {"foo": ["1", "3", "5"], "bar": "2"},
)
# invalid arguments