examples
frequenz.repo.config.pytest.examples ¤
Utility to enable linting of code examples in docstrings.
Code examples are often wrapped in triple backticks (```python
) within our docstrings.
This plugin extracts these code examples and validates them using pylint.
The main utility function is
get_sybil_arguments()
,
which returns a dictionary that can be used to pass to the Sybil()
constructor.
You still need to create a conftest.py
file in the root of your project's sources,
typically src/conftest.py
, with the following contents:
from frequenz.repo.config.pytest import examples
from sybil import Sybil
pytest_collect_file = Sybil(**examples.get_sybil_arguments()).pytest()
Classes¤
frequenz.repo.config.pytest.examples.MyPythonCodeBlockParser ¤
Bases: PythonCodeBlockParser
Custom Python code block parser that uses the custom code block parser.