def assert_regex_output(self, expected):
        """Asserts that the current output string contains the expected
        regex."""
        output = self._captured.after
        decoded = output.decode('utf-8')
        done_str = decoded.splitlines()[0]
        found = re.match(expected, done_str)
        assert found, f'decoded={decoded}\nexpected={expected})'
Asserts that the current output string contains the expected
        regex.
numba/tests/gdb_support.py