Skip to content

Conversation

@mjvogelsong
Copy link
Contributor

@mjvogelsong mjvogelsong commented Apr 3, 2023

We can test the code block examples in our docs using pytest-markdown-docs! This should help us make sure our documentation examples are always runnable.

One open question is whether it is better to make most/every example a complete example? As a user of SDK docs, I kinda prefer that, because then every code block becomes fully-functional without any assumptions. We can highlight the "important" part of the code. But I do also think there's value in having shorter code snippets to focus on the important part. There is a python continuation fence that we can use to test against a series of python blocks.

TODOs:

  • It already found some bugs -- e.g., we don't expose a confidence parameter in get_or_create_detector(). Gotta fix that.
  • It would be nice to put asserts inline with the code blocks, but not render them...
  • Switch all tests to hit prod instead of integ

For example, say you want to set your desired confidence level to 0.95, but that you're willing to wait up to 60 seconds to get a confident response.

```python
<!-- TODO: turn on `confidence` parameter, and re-enable tests! -->
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotta fix this

Copy link
Contributor

@tyler-romero tyler-romero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Base automatically changed from try-docusaurus-base to main April 5, 2023 21:38
@mjvogelsong mjvogelsong marked this pull request as ready for review April 11, 2023 18:19
@mjvogelsong mjvogelsong merged commit 82381b6 into main Apr 12, 2023
@mjvogelsong mjvogelsong deleted the pytest-against-md branch April 12, 2023 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants