testing-cabal / testtools

Testtools - tasteful testing for python
https://testtools.readthedocs.io/en/latest/
Other
94 stars 88 forks source link

Allow skip/skipIf/skipUnless as class decorators #268

Closed zaneb closed 4 years ago

zaneb commented 6 years ago

In unittest/unittest2 the skip/skipIf/skipUnless decorators can be used to decorate either individual test methods or entire TestCase classes. However, the testtools equivalents could previously only be used to decorate test methods. If used on a TestCase the class would be replaced with a function, resulting in the tests either not be discovered at all or (if a custom test loader was used) potentially an error.

This change allows the skip decorators to be used on the TestCase subclass, for equivalent functionality with unittest.

Fixes #205

zaneb commented 6 years ago

The build failed on Python 3.3 because Sphinx is no longer available for Python 3.3. Other than that, everything passed.

The Travis build is fixed by either #269 or #266