Skip to content

Add ATTACH_ON_FAILURE environment variable feature#6

Merged
sethorpe merged 1 commit intomainfrom
feature/attach-on-failure
Nov 7, 2025
Merged

Add ATTACH_ON_FAILURE environment variable feature#6
sethorpe merged 1 commit intomainfrom
feature/attach-on-failure

Conversation

@sethorpe
Copy link
Owner

@sethorpe sethorpe commented Nov 7, 2025

Implements automatic HTTP request/response recording when ATTACH_ON_FAILURE=true. When enabled, the pytest hook automatically attaches exchanges to Allure on test failure.

Changes:

  • Modified client.py to check ATTACH_ON_FAILURE env var
  • Records exchanges silently without immediate attachment
  • Pytest hook attaches on failure for automatic debugging

Tests Added:

  • test_attach_on_failure.py: Unit test with mock transport
  • test_pytest_hook_attach_on_failure.py: Hook integration test
  • test_attach_on_failure_integration.py: Real Spotify API validation
  • test_attach_on_failure_demo.py: Demo test (skipped by default)

Other:

  • Fixed Makefile serve-report target to use poetry run

All tests passing: 24/24 (1 skipped demo test)

Implements automatic HTTP request/response recording when ATTACH_ON_FAILURE=true.
When enabled, the pytest hook automatically attaches exchanges to Allure on test failure.

Changes:
- Modified client.py to check ATTACH_ON_FAILURE env var
- Records exchanges silently without immediate attachment
- Pytest hook attaches on failure for automatic debugging

Tests Added:
- test_attach_on_failure.py: Unit test with mock transport
- test_pytest_hook_attach_on_failure.py: Hook integration test
- test_attach_on_failure_integration.py: Real Spotify API validation
- test_attach_on_failure_demo.py: Demo test (skipped by default)

Other:
- Fixed Makefile serve-report target to use poetry run

All tests passing: 24/24 (1 skipped demo test)
@sethorpe sethorpe merged commit ece53af into main Nov 7, 2025
1 check passed
@sethorpe sethorpe deleted the feature/attach-on-failure branch November 7, 2025 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant