Feat/doc example testing - #250
Conversation
There was a problem hiding this comment.
ERROR - Config value 'markdown_extensions': Failed to load extension 'pymdownx.snippets'.
ModuleNotFoundError: No module named 'pymdownx'
Aborted with a configuration error!
Extension does not work locally, need to be document it to run with uv run mkdocs serve command.
There was a problem hiding this comment.
Why do we need matplotlib dependency?
There was a problem hiding this comment.
This is not part of this PR.
There was a problem hiding this comment.
This is not part of this PR.
There was a problem hiding this comment.
The approach looks interesting :) . I added some formatting comments please take a look into them.
Could you also look into ways to tests that the examples work? It will interesting to have some type of automation.
For example create a unittest file with a class call TestExamples. To check if the example works, maybe you can simple add an import to check that it will not crash or use the subprocess.run method with check=True (https://docs.python.org/3/library/subprocess.html)
3db6ff0 to
28a1d6d
Compare
|
Thanks for the review! Addressed all your points:
|
|
Update: added the runnable, tested examples for all parsers as well (same pattern as the detectors). |
Description
Adds automated testing for the Python code snippets in the detector documentation.
The example usage - blocks in the docs are now extracted and executed as tests, so they
stay in sync with the actual API and don't silently break when the code changes.
Also adds runnable, tested doc examples for all detectors.
How Has This Been Tested?
The documentation snippets are run as automated tests via the new test in
tests/test_docs/test_doc_examples.py. All tests pass locally.
Checklist
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.