Skip to content

BaseAPIClient: add request_session constructor argument #255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

risicle
Copy link
Member

@risicle risicle commented Mar 2, 2025

What problem does the pull request solve?

This allows a pre-constructed requests.Session object to be used by the api client, which is useful for some esoteric use cases.

Checklist

  • I’ve used the pull request template
  • I’ve written unit tests for these changes
  • I’ve updated the documentation in
  • I’ve bumped the version number in
    • notifications_python_client/__init__.py
  • I've added new environment variables to
    • notifications-python-client/scripts/generate_docker_env.sh
    • notifications-python-client/tox.ini
    • CONTRIBUTING.md

risicle added 2 commits March 1, 2025 23:04
for injecting an externally constructed/configured
requests.Session object
@quis
Copy link
Member

quis commented Mar 5, 2025

This could do with a lightweight test in https://github.com/alphagov/notifications-python-client/blob/main/tests/notifications_python_client/test_base_api_client.py to validate that multiple instances of the client are sharing the same object

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.

2 participants