Exemplo n.º 1
0
 def test_typechecking(self):
     from _pytest.recwarn import WarningsChecker
     with pytest.raises(TypeError):
         WarningsChecker(5)
     with pytest.raises(TypeError):
         WarningsChecker(('hi', RuntimeWarning))
     with pytest.raises(TypeError):
         WarningsChecker([DeprecationWarning, RuntimeWarning])
Exemplo n.º 2
0
    def test_typechecking(self) -> None:
        from _pytest.recwarn import WarningsChecker

        with pytest.raises(TypeError):
            WarningsChecker(5, _ispytest=True)  # type: ignore[arg-type]
        with pytest.raises(TypeError):
            WarningsChecker(("hi", RuntimeWarning), _ispytest=True)  # type: ignore[arg-type]
        with pytest.raises(TypeError):
            WarningsChecker([DeprecationWarning, RuntimeWarning], _ispytest=True)  # type: ignore[arg-type]
Exemplo n.º 3
0
    def test_typechecking(self) -> None:
        from _pytest.recwarn import WarningsChecker

        with pytest.raises(TypeError):
            WarningsChecker(5)  # type: ignore
        with pytest.raises(TypeError):
            WarningsChecker(("hi", RuntimeWarning))  # type: ignore
        with pytest.raises(TypeError):
            WarningsChecker([DeprecationWarning,
                             RuntimeWarning])  # type: ignore