def test_exception_timing(): result = parse_filterlist(['! good line', '%bad line%']) assert next(result) == Comment('good line') with pytest.raises(ParseError): next(result)
def test_parse_filterlist(): result = parse_filterlist(['! foo', '! Title: bar']) assert list(result) == [Comment('foo'), Metadata('Title', 'bar')]