These forms catch every Exception, which can lead to tests passing even if, e.g., the code under consideration raises a SyntaxError or IndentationError.
Either assert for a more specific exception (builtin or custom), or use assertRaisesRegex or pytest.raises(..., match=<REGEX>) respectively.
https://github.com/populse/soma-base/blob/51191238ee995a7b0863e4b7372bb8060cecb8b9/python/soma/controller/tests/test_controller.py#L1087
https://docs.astral.sh/ruff/rules/assert-raises-exception/