diff --git a/tests-extra/runtests.py b/tests-extra/runtests.py
index d2d6cfaca7b87f7e05d41c8f4b0aecbdfeac6d7c..9ac3b27ac6f5b74b1c3ac3eb0de41fb444104ffc 100755
--- a/tests-extra/runtests.py
+++ b/tests-extra/runtests.py
@@ -116,7 +116,7 @@ def parse_args(cmd_args):
     # Filter out excluded tests.
     for test, cases in excluded.items():
         if cases:
-            if included[test]:
+            if test in included:
                 for case in cases:
                     included[test].remove(case)
         else: