Framework Mode - Testing exception chains
Folder Structure
tests/ ├── test_exception_chains.py utilities/ ├── exception_helpers.py conftest.py pytest.ini
tests/ ├── test_exception_chains.py utilities/ ├── exception_helpers.py conftest.py pytest.ini
test_exception_chains.py where exception chain tests are written using pytest.raises() and __cause__ or __context__ checks.exception_helpers.py to create custom chained exceptions or extract messages.pytest.ini and conftest.py for test setup, fixtures, and environment configuration.pytest-html for readable HTML reports showing exception details.pytest.raises() context manager to catch exceptions and assert on the exception chain explicitly.__cause__ and __context__ attributes to verify the chain of exceptions is correct.Where would you add a new helper function to create a custom chained exception for reuse in multiple tests?