def test_strip_comment_invalid(): with pytest.raises(ValueError, match="Missing closing quote"): cbook._strip_comment('grid.color: "aa')
def test_strip_comment(line, result): """Strip everything from the first unquoted #.""" assert cbook._strip_comment(line) == result