tarpas / pytest-testmon

Selects tests affected by changed files. Executes the right tests first. Continuous test runner when used with pytest-watch.
https://testmon.org
MIT License
800 stars 54 forks source link

Have a command line that outputs all the tests which reach a certain line in the code #217

Closed PeterKogan closed 1 year ago

PeterKogan commented 1 year ago

I sometimes encounter a line in one of the code functions and I'm not sure if it's covered and by which tests.

It would be great to have a command line that outputs all the tests which reach a certain line in the code.

tarpas commented 1 year ago

Hi, thanks for a suggestion. However, testmon doesn't store this information with line granularity. coveragepy has this functionality in the form of contexts. (And I'm not sure it's very widely used). You can change a line and run pytest --testmon and see what gets executed :). At this point I don't think it's worth adding and maintaining a functionality like this in testmon.