def test_location(self): matcher = FullFirstMatch(Any('a')[:] & Eos()) matcher.config.clear() try: list(matcher.match_string('aab')) assert False, 'expected error' except FullFirstMatchException as e: assert str(e) == """The match failed at 'b', Line 1, character 2 of str: 'aab'.""", str(e)