[tests] allow filtering extractor result tests by URL or comment

python test_results.py twitter:+/i/web/
python test_results.py twitter:~twitpic
pull/5516/head
Mike Fährmann 5 months ago
parent 347af7f5c8
commit 068ccfe0b3
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -442,7 +442,15 @@ def generate_tests():
tests = results.category(category)
if subcategory:
tests = [t for t in tests if t["#category"][-1] == subcategory]
if subcategory.startswith("+"):
url = subcategory[1:]
tests = [t for t in tests if url in t["#url"]]
elif subcategory.startswith("~"):
com = subcategory[1:]
tests = [t for t in tests
if "#comment" in t and com in t["#comment"].lower()]
else:
tests = [t for t in tests if t["#category"][-1] == subcategory]
else:
tests = results.all()

Loading…
Cancel
Save