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

Fix logging of cached response

Merged
merged 1 commit into from Nov 25, 2019

Conversation

xavfernandez
Copy link
Member

@xavfernandez xavfernandez commented Nov 22, 2019

Cached responses often (always ?) provide a length meaning they were
never logged as such.

Not sure if a test is needed: it would involve passing a mocked response to _prepare_download and checking if the caplogs contains "Using cached"...

@xavfernandez xavfernandez requested a review from chrahunt Nov 22, 2019
Copy link
Member

@chrahunt chrahunt left a comment

I think a test here would be good - the uses of resp in this function are fairly limited, mostly just constructing generators, so it shouldn't require mocking much. More tests also means more confidence when refactoring, which this file is seeing a lot of.

@xavfernandez
Copy link
Member Author

xavfernandez commented Nov 25, 2019

Test added (which caused #7397)

Cached responses often (always ?) provide a length meaning they were
never logged as such.
@xavfernandez xavfernandez merged commit db1a275 into pypa:master Nov 25, 2019
26 checks passed
@xavfernandez
Copy link
Member Author

xavfernandez commented Nov 25, 2019

Thanks for the reviews :)

@xavfernandez xavfernandez deleted the log_cached_response branch Nov 25, 2019
@lock lock bot added the auto-locked label Dec 26, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants