Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pytest-watch with coverage (If not existent) #639

Open
brunolnetto opened this issue Apr 3, 2024 · 0 comments
Open

Pytest-watch with coverage (If not existent) #639

brunolnetto opened this issue Apr 3, 2024 · 0 comments

Comments

@brunolnetto
Copy link

What's the problem this feature will solve?

I can:

  1. run tests with package pytest-cov by command run coverage run --rcfile=.coveragerc -m pytest.
  2. generate coverage with package pytest-cov by command run coverage report --show-missing.
  3. watch tests with package pytest-watch by command run ptw --quiet --spool 200 --clear --nobeep --config pytest.ini --ext=.py --onfail="echo Tests failed, fix the issues" -v

I would like to have a way to watch coverage while testing as well. May you enlight me?

Describe the solution you'd like

I wrote following bash script ith desired solution:

#!/bin/bash
clear

while true; do
  coverage run --rcfile=.coveragerc -m pytest
  coverage report --show-missing
  
  sleep 5  # Adjust delay between test runs if needed
  clear
done

Alternative Solutions

I have not found the proper way to proceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant