You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing tests for my cookiecutter repo using the pytest-cookies library and I would like to be able to measure how much of the pre-/post-generation scripts in the hooks/ directory are covered by my tests. When using pytest --cov tests/, I get 0% coverage of my hooks, despite them getting called during the cookies.bake(...) calls in my tests.
I am guessing this is because the hooks are actually Jinja2 templates, meaning the coverage tool doesn't pick up the generated script. Has anyone successfully set up a coverage measurement for their hooks or have any suggestions for me regarding how to solve this challenge?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am writing tests for my cookiecutter repo using the
pytest-cookies
library and I would like to be able to measure how much of the pre-/post-generation scripts in thehooks/
directory are covered by my tests. When usingpytest --cov tests/
, I get 0% coverage of my hooks, despite them getting called during thecookies.bake(...)
calls in my tests.I am guessing this is because the hooks are actually Jinja2 templates, meaning the coverage tool doesn't pick up the generated script. Has anyone successfully set up a coverage measurement for their hooks or have any suggestions for me regarding how to solve this challenge?
Beta Was this translation helpful? Give feedback.
All reactions