コード例 #1
0
 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")
コード例 #2
0
ファイル: test_validation.py プロジェクト: jakirkham/bokeh
 def test_Bool(self):
     p = Bool()
     with pytest.raises(ValueError) as e:
         p.validate("junk")
     assert not str(e).endswith("ValueError")
コード例 #3
0
ファイル: test_validation.py プロジェクト: jakirkham/bokeh
 def test_Bool(self, detail):
     p = Bool()
     with pytest.raises(ValueError) as e:
         p.validate("junk", detail)
     assert str(e).endswith("ValueError") == (not detail)
コード例 #4
0
 def test_Bool(self, detail) -> None:
     p = Bool()
     with pytest.raises(ValueError) as e:
         p.validate("junk", detail)
     assert (str(e.value) == "") == (not detail)
コード例 #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)
コード例 #6
0
 def test_Bool(self):
     p = Bool()
     with pytest.raises(ValueError) as e:
         p.validate("junk")
     assert not str(e).endswith("ValueError")