Esempio 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])
Esempio 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]
Esempio 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