def test_MinMaxBounds(self) -> None:
     p = MinMaxBounds()
     with pytest.raises(ValueError) as e:
         p.validate(10)
     assert matches(
         str(e.value),
         r"expected an element of either Auto, Tuple\(Float, Float\) or Tuple\(TimeDelta, TimeDelta\), got 10"
     )
Beispiel #2
0
 def test_MinMaxBounds(self, detail):
     p = MinMaxBounds()
     with pytest.raises(ValueError) as e:
         p.validate(10, detail)
     assert str(e).endswith("ValueError") == (not detail)
Beispiel #3
0
 def test_MinMaxBounds(self):
     p = MinMaxBounds()
     with pytest.raises(ValueError) as e:
         p.validate(10)
     assert not str(e).endswith("ValueError")
 def test_MinMaxBounds(self, detail) -> None:
     p = MinMaxBounds()
     with pytest.raises(ValueError) as e:
         p.validate(10, detail)
     assert (str(e.value) == "") == (not detail)
 def test_MinMaxBounds(self) -> None:
     p = MinMaxBounds()
     with pytest.raises(ValueError) as e:
         p.validate(10)
     assert matches(str(e.value), r"expected an element of either .*, got 10")
Beispiel #6
0
 def test_MinMaxBounds(self, detail):
     p = MinMaxBounds()
     with pytest.raises(ValueError) as e:
         p.validate(10, detail)
     assert str(e).endswith("ValueError") == (not detail)
Beispiel #7
0
 def test_MinMaxBounds(self):
     p = MinMaxBounds()
     with pytest.raises(ValueError) as e:
         p.validate(10)
     assert not str(e).endswith("ValueError")