From 068ccfe0b3b7b7438baa0deb75b565fc3dfd01d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 19 Apr 2024 22:41:39 +0200 Subject: [PATCH] [tests] allow filtering extractor result tests by URL or comment python test_results.py twitter:+/i/web/ python test_results.py twitter:~twitpic --- test/test_results.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/test_results.py b/test/test_results.py index 05946182..8175e3f2 100644 --- a/test/test_results.py +++ b/test/test_results.py @@ -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()