Skip to content
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

add support for providing a custom requests.Session in client #39

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

syphar
Copy link
Contributor

@syphar syphar commented Nov 28, 2023

Checklist for your PR

  • please start with a draft PR and mark it as ready for review when you are confident that your implementation works as expected.
  • add a changelog entry in CHANGELOG.md with a link to this PR.
  • make sure that all tests pass and add new test functions if your code is not covered by existing tests. Please use mock tests when network requests are required.
  • let someone review & approve your code, make changes where necessary.

Hints

  • name your branches accordingly: use the prefixes bugfix/, feature/, or release/ and then a short title for your PR in kebab-case (lowercase words separated with dashes), e.g. feature/my-awesome-feature.
  • Please make sure that pre-commit hooks are enabled on your system to avoid common mistakes before you make a commit.
  • feel free to delete this template and replace it with your own description of the PR.

Copy link

codecov bot commented Nov 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b5ead78) 87.31% compared to head (51915ea) 87.32%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #39      +/-   ##
==========================================
+ Coverage   87.31%   87.32%   +0.01%     
==========================================
  Files           7        7              
  Lines         946      947       +1     
==========================================
+ Hits          826      827       +1     
  Misses        120      120              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@syphar
Copy link
Contributor Author

syphar commented Nov 28, 2023

@klamann we found that this feature would have helped us writing cleaner code.

In our case we wanted retries for HTTP requests, and with the option to hand in a custom session this would have worked more easily.

Another usecase I can imagine for this would be proxies.

If the general feature is fine with you, I'll do tests & changelog.

@klamann
Copy link
Contributor

klamann commented Dec 1, 2023

I like the idea, and the change seems to be simple enough. I'm willing to merge this if you add a test case and changelog entry.

@syphar syphar changed the title add support for a custom requests session in client add support for providing a custom requests.Session in client Dec 4, 2023
@syphar syphar marked this pull request as ready for review December 4, 2023 08:39
@syphar
Copy link
Contributor Author

syphar commented Dec 4, 2023

@klamann I updated the changelog, and added a short test with a custom session.

@klamann
Copy link
Contributor

klamann commented Dec 22, 2023

sorry for the deplay; merging!

@klamann klamann merged commit cefc627 into at-gmbh:master Dec 22, 2023
8 checks passed
@syphar syphar deleted the custom-requests-sessoin branch December 22, 2023 15:38
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