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
Merged

Conversation

@xavfernandez
Copy link
Contributor

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 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 xavfernandez force-pushed the xavfernandez:log_cached_response branch from f6a2094 to 6538d11 Nov 24, 2019
@xavfernandez

This comment has been minimized.

Copy link
Contributor 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 force-pushed the xavfernandez:log_cached_response branch from 6538d11 to 02d3fe5 Nov 25, 2019
@xavfernandez xavfernandez merged commit db1a275 into pypa:master Nov 25, 2019
26 checks passed
26 checks passed
🤖 (ubuntu-18.04, docs)
Details
🤖 (ubuntu-18.04, lint)
Details
Linux #20191125.8 succeeded
Details
Linux (Package) Package succeeded
Details
Linux (Test Primary Python27) Test Primary Python27 succeeded
Details
Linux (Test Primary Python36) Test Primary Python36 succeeded
Details
Linux (Test Secondary Python35) Test Secondary Python35 succeeded
Details
Linux (Test Secondary Python37) Test Secondary Python37 succeeded
Details
Windows #20191125.8 succeeded
Details
Windows (Package) Package succeeded
Details
Windows (Test Primary Python27-x86) Test Primary Python27-x86 succeeded
Details
Windows (Test Primary Python35-x64) Test Primary Python35-x64 succeeded
Details
Windows (Test Primary Python37-x64) Test Primary Python37-x64 succeeded
Details
Windows (Test Secondary Python35-x86) Test Secondary Python35-x86 succeeded
Details
Windows (Test Secondary Python36-x86) Test Secondary Python36-x86 succeeded
Details
Windows (Test Secondary Python37-x86) Test Secondary Python37-x86 succeeded
Details
continuous-documentation/read-the-docs Read the Docs build succeeded!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
macOS #20191125.8 succeeded
Details
macOS (Package) Package succeeded
Details
macOS (Test Primary Python27) Test Primary Python27 succeeded
Details
macOS (Test Primary Python36) Test Primary Python36 succeeded
Details
macOS (Test Secondary Python35) Test Secondary Python35 succeeded
Details
macOS (Test Secondary Python37) Test Secondary Python37 succeeded
Details
news-file/pr News files updated and/or change is trivial.
Details
@xavfernandez

This comment has been minimized.

Copy link
Contributor Author

xavfernandez commented Nov 25, 2019

Thanks for the reviews :)

@xavfernandez xavfernandez deleted the xavfernandez:log_cached_response branch Nov 25, 2019
@lock lock bot added the S: 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.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.