def test_exception(self): matcher = FullFirstMatch(Any('a')) matcher.config.clear() try: list(matcher.match('b')) assert False, 'expected error' except FullFirstMatchException as e: assert str(e) == """The match failed at 'b', Line 1, character 0 of str: 'b'.""", str(e)