def test_file_name_reporting():

    def grammar():      return Optional('a'), 'b', EOF

    parser = ParserPython(grammar)

    try:
        parser.parse("\n\n   a c", file_name="test_file.peg")
    except NoMatch as e:
        assert "Expected 'b' at test_file.peg:(3, 6)" in str(e)
Test that if parser has file name set it will be reported.
dataset/ETHPy150Open igordejanovic/Arpeggio/tests/unit/test_error_reporting.py/test_file_name_reporting