-
Notifications
You must be signed in to change notification settings - Fork 31
Re-add execution of doctests #768
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,23 +34,23 @@ If no ``server`` argument (or no argument at all) is passed, the default one | |
|
|
||
| When using a list of servers, the servers are selected by round-robin: | ||
|
|
||
| >>> invalid_host = "invalid_host:9999" | ||
| >>> even_more_invalid_host = "even_more_invalid_host:9999" | ||
| >>> http_client = HttpClient([crate_host, invalid_host, even_more_invalid_host], timeout=0.3) | ||
| >>> invalid_host1 = "192.0.2.1:9999" | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| >>> invalid_host2 = "192.0.2.2:9999" | ||
| >>> http_client = HttpClient([crate_host, invalid_host1, invalid_host2], timeout=0.3) | ||
| >>> http_client._get_server() | ||
| 'http://127.0.0.1:44209' | ||
|
|
||
| >>> http_client._get_server() | ||
| 'http://invalid_host:9999' | ||
| 'http://192.0.2.1:9999' | ||
|
|
||
| >>> http_client._get_server() | ||
| 'http://even_more_invalid_host:9999' | ||
| 'http://192.0.2.2:9999' | ||
|
|
||
| >>> http_client.close() | ||
|
|
||
| Servers with connection errors will be removed from the active server list: | ||
|
|
||
| >>> http_client = HttpClient([invalid_host, even_more_invalid_host, crate_host], timeout=0.3) | ||
| >>> http_client = HttpClient([invalid_host1, invalid_host2, crate_host], timeout=0.3) | ||
| >>> result = http_client.sql('select name from locations') | ||
| >>> http_client._active_servers | ||
| ['http://127.0.0.1:44209'] | ||
|
|
@@ -64,19 +64,17 @@ sleep after the first request:: | |
| >>> import time; time.sleep(1) | ||
| >>> server = http_client._get_server() | ||
| >>> http_client._active_servers | ||
| ['http://invalid_host:9999', | ||
| 'http://even_more_invalid_host:9999', | ||
| 'http://127.0.0.1:44209'] | ||
| ['http://127.0.0.1:44209', 'http://192.0.2.2:9999', 'http://192.0.2.1:9999'] | ||
| >>> http_client.close() | ||
|
|
||
| If no active servers are available and the retry interval is not reached, just use the oldest | ||
| inactive one: | ||
|
|
||
| >>> http_client = HttpClient([invalid_host, even_more_invalid_host, crate_host], timeout=0.3) | ||
| >>> http_client = HttpClient([invalid_host1, invalid_host2, crate_host], timeout=0.3) | ||
| >>> result = http_client.sql('select name from locations') | ||
| >>> http_client._active_servers = [] | ||
| >>> http_client._get_server() | ||
| 'http://invalid_host:9999' | ||
| 'http://192.0.2.1:9999' | ||
| >>> http_client.close() | ||
|
|
||
| SQL Statements | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't investigated why, but on my machine resolving a hostname that doesn't exist takes way longer than having it resolve to localhost on a port where hopefully nothing runs.
Potential follow up would be to generally restructure this. http.rst and client.rst have lots of overlap.