-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Tests are not showing as "Skipped" when a unittest.SkipTest error is raised inside setUpClass() #159
Comments
Wow! Thanks for the thorough write-up. This was a tricky issue. It all boiled down to Python treating a To fix this I chose to override the exception-handling of the code that runs
|
This fix is included in version 2.8.2 (just released). |
Yup, that looks to have cleared things up! Thanks a bunch. |
Hello, |
@threexc The thought hadn't occurred to me! I created #215 to track contributing the fix to upstream, but I have no idea when I'll be able to get to it. I included a link to the actual few lines that are the fix, so if you or anyone else would like to have the fun of contributing it upstream, please go ahead! 😄 |
Summary
It appears that green is not handling raised
unittest.SkipTest
exceptions insetUpClass()
as expected. It's silently skipping the entire class instead of verbosely skipping them.Steps to Reproduce
Make this file:
and then run:
Actual
Expected
For comparison, here's the output of
nose2 green_skiptest_error -vvv
andpython green_skiptest_error.py
:skipped Intentionally throwing SkipTest exception ---------------------------------------------------------------------- Ran 0 tests in 0.001s OK (skipped=1)
Versions
Listed in all the code snippets, but here they are anyway:
Investigation
If
SkipTest
is raised inside a test method rather than thesetUpClass
method, then things work as expected:Throwing
SkipTest
insidesetUp
works correctlyComments
When an entire class is skipped, the skip message should be listed on the class output and the test output. Example (colors are simply listed in square brackets at the end of the line):
(However, this probably should be a separate issue/feature request)
The text was updated successfully, but these errors were encountered: