You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refactor test cases that import from private namespace. #2492
We have some test cases that import from private namespace inside httpx.
This is clearly a code-smell, because our test cases ought to be tests against our public API, rather than testing implementation details. Perhaps there's some cases where it's a necessary hack, but... perhaps not?
It'd be worthwhile reviewing if we're able to remove all the cases where we're doing this. I'd suggest that any pull requests resolving this are handled on a one-module-at-a-time basis.
Activity
lovelydinosaur commentedon Dec 6, 2022
Similar... can we also avoid/drop uses of
mock.patch(...)?lovelydinosaur commentedon Dec 30, 2022
Reminder to self...
Cases currently still left are these:
florimondmanca commentedon Feb 5, 2023
I pushed a bunch of PRs which get most of the remaining refactoring done.
The last bits are in
test/test_utils.py, which unit test actual utility functions that I don't think are easy or relevant to test through public API.lovelydinosaur commentedon May 9, 2023
Follow up from my previous comment...
Drop private imports from test_proxies.py
T-256 commentedon Jan 16, 2024
Only
test_utils.pyimports these private namespaces:httpx.SSLContextconfiguration. #3022is_https_redirectvia public api #3064obfuscate_sensitive_headersvia public api #3063parse_header_linksvia public api #3061same_originvia public api #3062