-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Fix status label #141
Fix status label #141
Conversation
status_label update is triggered by assignment of test results in process_finished. In case of no results, process_finished is called with an empty list of testresults. This empty list must also be assigned in order to trigger the status_label update, otherwise the status remains "Running tests ..." after finishing. So we have to differentiate between None and [] in the if clause.
and make parsing errors in unittestrunner.load_data indeed ignored siently (it relies on the condition that the result includes the final line of all dashes, otherwise an Indexerror will occur)
When I tried your PR, I didn't see any change here. If I use the plugin to run pytest in a directory with no tests, the label still shows "Running tests ..." after pytest is finished. Further testing suggests this depends on the testing framework. If I use the unittest framework, then your fix does work correctly. Could you please have a look? Which testing framework did you use? The way the pytest framework is handled in the plugin is a bit more complicated, so there is more scope for errors. |
I forgot to say, thanks for your work and especially for including the tests! |
and add integration test for all three test frameworks for this condition.
Codecov Report
|
Oh - this is the problem when we don't have enough tests :). At first I wanted to add an integration test but then decided for just the unit test ( So anyway I fixed it now and added a small integration test ( |
Looks good now, this is going in. Thanks! |
Fix status_label if no results to show
status_label update is triggered by assignment of test results in
process_finished. In case of no results, process_finished is called
with an empty list of testresults. This empty list must also be
assigned in order to trigger the status_label update, otherwise the
status remains "Running tests ..." after finishing. So we have to
differentiate between None and [] in the if clause.
Without the fix it looks like this after running when no tests were discovered:
Reset status_label when running tests is stopped
and make parsing errors in unittestrunner.load_data indeed ignored silently
(it relies on the condition that the result includes the final line of all
dashes, otherwise an Indexerror will occur)
Without the fix the status label "Running tests ..." remains visible after stopping
the run.