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