kaste / PyTest

pytest runner and view annotator for sublime text
21 stars 6 forks source link

Enhancement: Indicate test status on function #20

Open pykong opened 5 years ago

pykong commented 5 years ago

@kaste First of all a Big Thanks for putting up this very facile plugin!

Visual Studio annotates functions with symbols indicating whether they passed a test or whether test coverage for a function exists (https://res.infoq.com/news/2017/02/Live-Unit-Testing/en/resources/live-test.gif).

I believe such visual indication would be a huge power-up for PyTest as well because of its directly linking test result on the very function being tested.

That feature could be implemented via phantoms. Alternatively, in a less favored implementation, the gutter could be used to display the symbols.

Mock-up: g884 (symbols for pass | fail | uncovered)

kaste commented 5 years ago

Looks interesting but I have no idea .. This basically combines coverage with test info, and we don't run coverage here (a user could). Your mock-up annotates the source code, the image you link to looks more like typical coverage annotations for test files.

How should we do this? How do you reduce the whole coverage info to just the function definition lines? How do you compute that a function failed, except when it throws of course.