def test_Date(self) -> None: p = Date() with pytest.raises(ValueError) as e: p.validate(object()) assert matches( str(e.value), r"Expected an ISO date string, got <object object at 0x.*>")
def test_Date(self): p = Date() with pytest.raises(ValueError) as e: p.validate(object()) assert matches( str(e.value), r"expected a date, string or timestamp, got <object object at 0x.*>" )
def test_Date(self, detail): p = Date() with pytest.raises(ValueError) as e: p.validate(p, detail) assert str(e).endswith("ValueError") == (not detail)
def test_Date(self): p = Date() with pytest.raises(ValueError) as e: p.validate(p) assert not str(e).endswith("ValueError")
def test_Date(self, detail) -> None: p = Date() with pytest.raises(ValueError) as e: p.validate(p, detail) assert (str(e.value) == "") == (not detail)