def test_Int(self) -> None:
     p = Int()
     with pytest.raises(ValueError) as e:
         p.validate("junk")
     assert matches(
         str(e.value),
         r"expected a value of type Integral, got junk of type str")
Beispiel #2
0
 def test_Int(self, detail):
     p = Int()
     with pytest.raises(ValueError) as e:
         p.validate("junk", detail)
     assert str(e).endswith("ValueError") == (not detail)
Beispiel #3
0
 def test_Int(self):
     p = Int()
     with pytest.raises(ValueError) as e:
         p.validate("junk")
     assert not str(e).endswith("ValueError")
 def test_Int(self, detail) -> None:
     p = Int()
     with pytest.raises(ValueError) as e:
         p.validate("junk", detail)
     assert (str(e.value) == "") == (not detail)
Beispiel #5
0
 def test_Int(self, detail):
     p = Int()
     with pytest.raises(ValueError) as e:
         p.validate("junk", detail)
     assert str(e).endswith("ValueError") == (not detail)
Beispiel #6
0
 def test_Int(self):
     p = Int()
     with pytest.raises(ValueError) as e:
         p.validate("junk")
     assert not str(e).endswith("ValueError")