def test_DashPattern(self) -> None: p = DashPattern() with pytest.raises(ValueError) as e: p.validate("junk") assert matches( str(e.value), r"expected an element of either Enum\(.*\), Regex\(.*\) or Seq\(Int\), got 'junk'" )
def test_DashPattern(self, detail): p = DashPattern() with pytest.raises(ValueError) as e: p.validate("junk", detail) assert str(e).endswith("ValueError") == (not detail)
def test_DashPattern(self): p = DashPattern() with pytest.raises(ValueError) as e: p.validate("junk") assert not str(e).endswith("ValueError")
def test_DashPattern(self, detail) -> None: p = DashPattern() with pytest.raises(ValueError) as e: p.validate("junk", detail) assert (str(e.value) == "") == (not detail)
def test_DashPattern(self, detail): p = DashPattern() with pytest.raises(ValueError) as e: p.validate("junk", detail) assert str(e).endswith("ValueError") == (not detail)
def test_DashPattern(self): p = DashPattern() with pytest.raises(ValueError) as e: p.validate("junk") assert not str(e).endswith("ValueError")