In the current main branch we have 32 python code blocks in guide and 17 in src:
rg '```python' guide/ | wc -l
32
rg '```python' src/ | wc -l
17
As the project grows, it might become increasingly hard to check if those blocks are correct and up to date.
Adding python doctest or similar to nox and the CI can guarantee the scalability. With those checks, some categories of issues like #3639 would not exist.
Requirements
- Have a way to skip tests (
+SKIP, no_run)
- Being able to run in
.md, .py and .rs files
- Hide any setup/teardown code in rendered documentation
- Don't burden the CI 🤖
Some examples have two code blocks, one for the code and the other for the output. We may need to change them to adhere to doctest syntax or write our own plugin to check their validity.
In the current
mainbranch we have 32 python code blocks inguideand 17 insrc:As the project grows, it might become increasingly hard to check if those blocks are correct and up to date.
Adding python doctest or similar to
noxand the CI can guarantee the scalability. With those checks, some categories of issues like #3639 would not exist.Requirements
+SKIP,no_run).md,.pyand.rsfiles