Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remove hardcoded expectation that a scheme must be either 'http' or 'https' in
BaseClient
andURL
classes. This moves towards being able to write dispatch handlers that have specific handling for differently named http-like schemes.New
BaseClient.accepted_schemes
property that gives the collection of schemes a client can handle.Test coverage for InvalidURL exception on unsupported schemes.
Motivation for the change comes from some test porting to
httpx
- where I found two cases where the current expectations made adapting existing code difficult:test:
scheme in unit tests for session handling.http+thing:
custom schemes that enable additional behaviours at the transport level.It may be doing this above the level of
httpx
client is wiser, but this branch as proposed seems reasonably harmless. Whether the (currently private) registry added forURL
port mappings should be exposed for additions can be a question for later.