File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -150,9 +150,23 @@ jobs:
150150 # - name: "Pylint Tests"
151151 # run: "poetry run pylint infrahub_sdk/"
152152 - name : " Unit Tests"
153- run : " poetry run pytest tests/unit/"
153+ run : " poetry run pytest --cov infrahub_sdk tests/unit/"
154154 - name : " Upload coverage to Codecov"
155155 run : |
156156 codecov --flags python-${{ matrix.python-version }}
157157 env :
158158 CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
159+
160+ # The pytest-cov plugin doesn't quite work with content that is
161+ # auto-imported by our own infrahub pytest plugin, this workaround
162+ # reports the missing lines
163+ - name : " Report coverage for pytest-plugin"
164+ if : matrix.python-version == '3.12'
165+ run : |
166+ source $(poetry env info --path)/bin/activate
167+ coverage run -m pytest tests/unit/pytest_plugin
168+ coverage report -m
169+ coverage xml
170+ codecov --flags python-filler-${{ matrix.python-version }}
171+ env :
172+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ filterwarnings = [
144144 " ignore:Module already imported so cannot be rewritten" ,
145145 " ignore:Deprecated call to" ,
146146]
147- addopts = " -vs --cov infrahub_sdk --cov -report term-missing --cov-report xml --dist loadscope"
147+ addopts = " -vs --cov-report term-missing --cov-report xml --dist loadscope"
148148
149149[tool .mypy ]
150150pretty = true
You can’t perform that action at this time.
0 commit comments