8000 Avoid test dependency on freezegun and python-dateutil by graingert · Pull Request #3056 · urllib3/urllib3 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Avoid test dependency on freezegun and python-dateutil #3056

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

Merged
merged 4 commits into from
Jun 7, 2023

Conversation

graingert
Copy link
Contributor
@graingert graingert commented Jun 2, 2023

freezegun depends on python-dateutil for date parsing, python-dateutil hasn't has a release since Jul 14, 2021, and it looks like it's simpler to patch time.time to test Retry instead

@graingert graingert changed the title avoid freezegun and dateutils avoid dev dep on freezegun and python-dateutil Jun 2, 2023
@graingert graingert force-pushed the avoid-freezegun-and-dateutils branch from 76aebbd to 777d63d Compare June 2, 2023 13:22
@graingert
Copy link
Contributor Author

it's important that Retry uses time.time() specifically rather than any of the other timers that freezegun also patches, eg time.monotonic(), because it's supposed to be parsing http Retry-After headers based on the current wall time

@pquentin pquentin added the Skip Changelog Pull requests that don't require a changelog entry label Jun 5, 2023
@graingert graingert requested a review from pquentin June 6, 2023 11:44
pquentin
pquentin previously approved these changes Jun 6, 2023
Copy link
Member
@pquentin pquentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM.

@pquentin
Copy link
Member
pquentin commented Jun 6, 2023

Wait no the failures are real. Can you please fix the tests?

sethmlarson
sethmlarson previously approved these changes Jun 6, 2023
@graingert graingert dismissed stale reviews from sethmlarson and pquentin via 72533eb June 6, 2023 13:54
@graingert graingert requested a review from pquentin June 6, 2023 14:16
@pquentin pquentin merged commit ead5da1 into urllib3:main Jun 7, 2023
@pquentin pquentin changed the title avoid dev dep on freezegun and python-dateutil Avoid test dependency on freezegun and python-dateutil Jun 7, 2023
@graingert graingert deleted the avoid-freezegun-and-dateutils branch June 8, 2023 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog Pull requests that don't require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0