Closed charlottekostelic closed 7 months ago
@charlottekostelic in the description you mention a removal of a test for a stale token from
test_query
but I don't see such changes in this PR. We should be testing for a stale token in this module since the check if it is still valid happens only here. Stale token tests were somewhat redundant in thetest_metadata_api
and it's OK to skip them there.
I removed the stale token test and that lowered the test coverage (the if session.authorization.is_expired()
block) so I added it back in but forgot to update the description.
@klinga I made a few changes:
WorldcatSession
rather than Query
RetryError
as an exception for Query
Edited to reflect changes:
Added option for users to add automatic retries to requests
total_retries
,backoff_factor
,status_forcelist
, andallowed_methods
as args inWorldcatSession
andMetadataSession
test_metadata_api.py
Somewhat related: there's an open enhancement request for
requests
asking to be able to refresh authentication header on retry. That functionality doesn't currently exist and it doesn't look like it's being worked on https://github.com/psf/requests/issues/5975