File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ jobs:
100100 fi
101101 - name : Install dependencies
102102 run : |
103- pip install pytest-cov
103+ pip install pytest-cov sybil
104104 pip install .
105105 - name : Ensure Python and source code are on same drive (Windows)
106106 if : ${{ matrix.os == 'windows-latest' }}
@@ -111,12 +111,12 @@ jobs:
111111 - name : Test with pytest (Ubuntu & macOS)
112112 if : ${{ matrix.os != 'windows-latest' }}
113113 run : |
114- pytest --cov=lineage tests
114+ pytest --cov=lineage tests README.md
115115 - name : Test with pytest (Windows)
116116 if : ${{ matrix.os == 'windows-latest' }}
117117 working-directory : C:\a\lineage\lineage
118118 run : |
119- pytest --cov=lineage tests
119+ pytest --cov=lineage tests README.md
120120 - name : Upload coverage to Codecov (Ubuntu & macOS)
121121 if : ${{ matrix.os != 'windows-latest' }}
122122 uses : codecov/codecov-action@v5
Original file line number Diff line number Diff line change 44 {
55 "label" : " Run All Tests" ,
66 "type" : " shell" ,
7- "command" : " source .venv/bin/activate && python -m pytest tests README.rst " ,
7+ "command" : " source .venv/bin/activate && python -m pytest tests README.md " ,
88 "group" : {
99 "kind" : " test" ,
1010 "isDefault" : true
1818 {
1919 "label" : " Test README Examples" ,
2020 "type" : " shell" ,
21- "command" : " source .venv/bin/activate && python -m doctest README.rst -v" ,
21+ "command" : " source .venv/bin/activate && python -m pytest README.md -v" ,
2222 "group" : " test" ,
2323 "presentation" : {
2424 "reveal" : " always" ,
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ To set up `lineage` for local development:
56565 . When you're done making changes, run all the tests with:
5757
5858 ```
59- $ pipenv run pytest --cov-report=html --cov=lineage tests
59+ $ pipenv run pytest --cov-report=html --cov=lineage tests README.md
6060 ```
6161
6262 :::{note}
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ pytest-cov = "*"
99sphinx = " *"
1010sphinx-rtd-theme = " *"
1111ruff = " *"
12+ sybil = " *"
1213
1314[packages ]
1415lineage = {editable = true ,path = " ." }
Original file line number Diff line number Diff line change 1+ """
2+ Pytest configuration for testing code examples in README.md using Sybil.
3+
4+ This conftest.py enables Sybil to parse and test Python code blocks in the
5+ README.md file as part of the pytest test suite. The PythonCodeBlockParser
6+ evaluates fenced Python code blocks (```python), while SkipParser allows
7+ selective skipping of examples using Markdown comments when needed.
8+ """
9+
10+ from sybil import Sybil
11+ from sybil .parsers .markdown import PythonCodeBlockParser , SkipParser
12+
13+ pytest_collect_file = Sybil (
14+ parsers = [
15+ PythonCodeBlockParser (),
16+ SkipParser (),
17+ ],
18+ patterns = ["README.md" ],
19+ ).pytest ()
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ addopts =
1919 -ra
2020 --strict
2121 --tb =short
22- -- doctest-glob =README.md
22+ -p no: doctest
2323
2424# http://coverage.readthedocs.io/en/latest/
2525[coverage:run]
You can’t perform that action at this time.
0 commit comments