diff --git a/testing/code/test_source.py b/testing/code/test_source.py index 3512a86f9a8..879b8fd37d8 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -166,7 +166,7 @@ def test_getstatementrange_bug(self) -> None: x = ( y + z) - except: + except Exception: pass """ ) diff --git a/testing/test_unittest.py b/testing/test_unittest.py index 395c9fe647e..a580cb0b1de 100644 --- a/testing/test_unittest.py +++ b/testing/test_unittest.py @@ -372,7 +372,7 @@ def run(self, result): result.add{type}(self, excinfo._excinfo) except KeyboardInterrupt: raise - except: + except Exception: pytest.fail("add{type} should not raise") def test_hello(self): pass