import pytest from pyparsing.exceptions import ParseException from xbc import loads_xbc, ParseError # this should fail but does not. @pytest.mark.xfail def test_whitespace_vc(): with pytest.raises(ParseError): loads_xbc('x = a\n, b') # this should fail but does not. @pytest.mark.xfail def test_extra_quote(): with pytest.raises(ParseException): loads_xbc("x = '''") def test_lone_plus(): with pytest.raises(ParseException): loads_xbc('+') def test_lone_rbrace(): with pytest.raises(ParseException): loads_xbc('}') def test_lone_lbrace(): with pytest.raises(ParseException): loads_xbc('{') def test_lone_braces(): with pytest.raises(ParseException): loads_xbc('{}') def test_lone_semi(): with pytest.raises(ParseException): loads_xbc(';') def test_empty(): with pytest.raises(ParseException): loads_xbc('\n') with pytest.raises(ParseException): loads_xbc('')