Message 46928 - Python tracker (original) (raw)
Logged In: YES user_id=568100
I don't think so. Basically, the patch changes the following:
- Adds a class SkippedException to the unittest module
- Adds a skipped attribute to TestResult, containing the list of skipped tests, and an addSkipped() method to add to the list.
- Catches the SkippedException in TestCase.call()
- Adds skip() and skipIf() to TestCase
- Modifies _TextTestResult and TextTestRunner to report skipped tests only if there are any
I see two potential problems:
- Test runners based on (or using the output of) TextTestRunner. I've taken care that the output is unchanged if there are no skipped tests.
- Code that uses repr() of a TestResult, as I extended it to always report skipped tests. I think this would be bad practice anyway.
However, to use the test-skipping functionality, custom test runners will obviously need to be extended to report skipped tests.
OTOH, I don't have a big test codebase to check. I read that e.g. Zope is using unittest. Maybe I can try to run their test suite with the patched unittest.py. I'll check.