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 #7393

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"...

Copy link
Member

@chrahunt chrahunt left a comment

Choose a reason for hiding this comment

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

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

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
@xavfernandez
Copy link
Member Author

Thanks for the reviews :)

@xavfernandez xavfernandez deleted the log_cached_response branch November 25, 2019 22:15
@lock lock bot added the auto-locked Outdated issues that have been locked by automation 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 Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants