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

"No tests found" now results in a failure. #124

Merged
merged 1 commit into from
May 31, 2016
Merged

"No tests found" now results in a failure. #124

merged 1 commit into from
May 31, 2016

Conversation

dougthor42
Copy link
Contributor

Fixes #123.

This changes the return value and text coloring when no tests are found.

I wasn't able to figure out where any unit tests for this should go (I have limited time today), so if you could let me know where they should go, I'll try writing some tomorrow.

@CleanCut
Copy link
Owner

Tests for green/cmdline.py go in green/test/test_cmdline.py.

Tests for green/result.py go in green/test/test_result.py

+ Moved location of "No tests found" failure logic to wasSuccessful()
+ Updated test_wasSuccessful so assert that 0 passes and 0 fails results in a failure.
+ Updated test_noTestsFound to verify that result.testsRun is 0 and wasSuccessful is False
@dougthor42
Copy link
Contributor Author

dougthor42 commented May 31, 2016

Alrighty, I updated things and added (well, modified) the relevant tests. I moved the logic for pass/fail out of cmdline.main() to the result.GreenTestResult.wasSuccessful() method so that things work everywhere.

I also squashed the commits so that you have a nice clean history (though there were only 2 commits originally...).

Once tests pass, I think it's ready to go. They passed locally so hopefully they do the same on CI.

@CleanCut CleanCut merged commit bc170d3 into CleanCut:master May 31, 2016
@coveralls
Copy link

coveralls commented May 31, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 4d2fadd on dougthor42:no-tests-found-results-in-failure into 568e024 on CleanCut:master.

@dougthor42 dougthor42 deleted the no-tests-found-results-in-failure branch June 14, 2016 20:44
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

Successfully merging this pull request may close these issues.

3 participants