-
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
Conversation
This comment was marked as spam.
This comment was marked as spam.
0addb72 to
d6663b9
Compare
d6663b9 to
1a80b98
Compare
| respond, the request is automatically routed to the next server: | ||
|
|
||
| >>> invalid_host = 'http://not_responding_host:4200' | ||
| >>> invalid_host = 'http://127.0.0.1:4201' |
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.
| >>> 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" |
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.
| makeSuite = unittest.TestLoader().loadTestsFromTestCase | ||
|
|
||
|
|
||
| def test_suite(): |
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.
pytest afaik doesn't support the test_suite discovery. Tests are picked up based on filename pattern and LayerTest/LayerUtilsTest still get executed
tests/test_docs.py
Outdated
| print(s) # noqa: T201 | ||
|
|
||
|
|
||
| def test_docs(doctest_node): |
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.
I also tried --doctest-glob="*.rst" (https://docs.pytest.org/en/stable/how-to/doctest.html) instead with a autouse fixture, but that would also be used in the other tests and we'd have two crate instances running in parallel.
So this seemed like the better option.
Follow up to #767
1a80b98 to
29a1fa9
Compare
amotl
left a comment
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.
Thank you very much. 💯
Follow up to #767