Skip to content

Add context manager support to AnticaptchaClient#121

Merged
ad-m merged 1 commit intomasterfrom
add-context-manager-support
Mar 7, 2026
Merged

Add context manager support to AnticaptchaClient#121
ad-m merged 1 commit intomasterfrom
add-context-manager-support

Conversation

@ad-m
Copy link
Owner

@ad-m ad-m commented Mar 7, 2026

Summary

  • Add __enter__, __exit__, and close() methods to AnticaptchaClient for clean requests.Session cleanup
  • Enable usage as with AnticaptchaClient(...) as client: to automatically close the session on exit
  • Add 5 tests covering context manager behavior

Test plan

  • pytest tests/test_base.py — all 31 tests pass

🤖 Generated with Claude Code

Enable clean resource cleanup of the underlying requests.Session
via `with` statement, `close()`, or `__exit__`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ad-m ad-m merged commit 149756f into master Mar 7, 2026
6 of 7 checks passed
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