validate: Place regex flags at the start of the regex
authorJan Schmidt <jan@centricular.com>
Mon, 26 Dec 2022 13:24:36 +0000 (00:24 +1100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 28 Dec 2022 10:04:41 +0000 (10:04 +0000)
In Python 3.11 it is an error to have regex flags in the middle
of an expression, so make sure they appear at the start.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1630

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3643>

subprojects/gst-devtools/validate/launcher/apps/gstvalidate.py
subprojects/gst-devtools/validate/launcher/baseclasses.py

index 46188f8..1aef8e6 100644 (file)
@@ -1333,8 +1333,8 @@ not been tested and explicitly activated if you set use --wanted-tests ALL""")
              "matroskademux.gst_matroska_demux_handle_seek_push: Seek end-time not supported in streaming mode"),
 
             # MPEG TS known issues:
-            ('(?i)*playback.reverse_playback.*(?:_|.)(?:|m)ts$',
-             "https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/97"),
+            ('*.playback.reverse_playback.*(?:_|.)(?:|m)ts$',
+             "https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/97", '(?i)'),
 
             # Fragmented MP4 disabled tests:
             ('*.playback..*seek.*.fragmented_nonseekable_sink_mp4',
index 65a3791..0368c3f 100644 (file)
@@ -1565,9 +1565,13 @@ class TestsManager(Loggable):
                 self.blacklisted_tests_patterns.append(re.compile(pattern))
 
     def set_default_blacklist(self, default_blacklist):
-        for test_regex, reason in default_blacklist:
+        for test_regex, reason, *re_flags in default_blacklist:
+            re_flags = re_flags[0] if re_flags else None
+
             if not test_regex.startswith(self.loading_testsuite + '.'):
                 test_regex = self.loading_testsuite + '.' + test_regex
+            if re_flags is not None:
+                test_regex = re_flags + test_regex
             self.blacklisted_tests.append((test_regex, reason))
             self._add_blacklist(test_regex)