notifications-python-client icon indicating copy to clipboard operation
notifications-python-client copied to clipboard

`BaseAPIClient`: add `request_session` constructor argument

Open risicle opened this issue 9 months ago • 1 comments

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

  • [x] I’ve used the pull request template
  • [ ] I’ve written unit tests for these changes
  • [x] I’ve updated the documentation in
  • [x] I’ve bumped the version number in
    • [x] 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 avatar Mar 02 '25 13:03 risicle

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

quis avatar Mar 05 '25 15:03 quis