def test_Float(self):
     p = Float()
     with pytest.raises(ValueError) as e:
         p.validate("junk")
     assert matches(
         str(e.value),
         r"expected a value of type Real, got junk of type (str|unicode)")
Пример #2
0
 def test_Float(self, detail):
     p = Float()
     with pytest.raises(ValueError) as e:
         p.validate("junk", detail)
     assert str(e).endswith("ValueError") == (not detail)
Пример #3
0
 def test_Float(self):
     p = Float()
     with pytest.raises(ValueError) as e:
         p.validate("junk")
     assert not str(e).endswith("ValueError")
Пример #4
0
 def test_Float(self, detail) -> None:
     p = Float()
     with pytest.raises(ValueError) as e:
         p.validate("junk", detail)
     assert (str(e.value) == "") == (not detail)
Пример #5
0
 def test_Float(self, detail):
     p = Float()
     with pytest.raises(ValueError) as e:
         p.validate("junk", detail)
     assert str(e).endswith("ValueError") == (not detail)
Пример #6
0
 def test_Float(self):
     p = Float()
     with pytest.raises(ValueError) as e:
         p.validate("junk")
     assert not str(e).endswith("ValueError")