They *do* work on unittest but they don't work from testtools:
## testtools + skipping
```python import unittest from testtools import skipIf
@skipIf(True, 'Ha!') class FooTests(unittest.TestCase):
def setUp(self): pass
def test_foo(self): print 'foo'
def test_bar(self): print 'bar'
unittest.main() ```
Result: Ran 0 tests in 0.000s
## testtools + no skipping
@skipIf(False, 'Ha!') class FooTests(unittest.TestCase):
Result: bar .foo . ---------------------------------------------------------------------- Ran 2 tests in 0.000s
## unittest + skipping
```python import unittest from unittest import skipIf
Result: ss ---------------------------------------------------------------------- Ran 2 tests in 0.000s
## unittest + no skipping
Result:
``` bar .foo . ---------------------------------------------------------------------- Ran 2 tests in 0.000s ```
On Thu, 24 Dec 2015 at 19:25 Robert Collins <email address hidden> wrote:
> I thought the decorators did work on classes? They do in unittest which > we largely derive from. > > -- > You received this bug notification because you are subscribed to the bug > report. > https://bugs.launchpad.net/bugs/1529047 > > Title: > Skipping all tests in a class is awkward > > To manage notifications about this bug go to: > https://bugs.launchpad.net/testtools/+bug/1529047/+subscriptions >
They *do* work on unittest but they don't work from testtools:
## testtools + skipping
```python
import unittest
from testtools import skipIf
@skipIf(True, 'Ha!') unittest. TestCase) :
class FooTests(
def setUp(self):
pass
def test_foo(self):
print 'foo'
def test_bar(self):
print 'bar'
unittest.main()
```
Result: Ran 0 tests in 0.000s
## testtools + no skipping
```python
import unittest
from testtools import skipIf
@skipIf(False, 'Ha!') unittest. TestCase) :
class FooTests(
def setUp(self):
pass
def test_foo(self):
print 'foo'
def test_bar(self):
print 'bar'
unittest.main()
```
Result: ------- ------- ------- ------- ------- ------- ------- ------- -------
bar
.foo
.
-------
Ran 2 tests in 0.000s
## unittest + skipping
```python
import unittest
from unittest import skipIf
@skipIf(True, 'Ha!') unittest. TestCase) :
class FooTests(
def setUp(self):
pass
def test_foo(self):
print 'foo'
def test_bar(self):
print 'bar'
unittest.main()
```
Result: ------- ------- ------- ------- ------- ------- ------- ------- -------
ss
-------
Ran 2 tests in 0.000s
## unittest + no skipping
```python
import unittest
from unittest import skipIf
@skipIf(False, 'Ha!') unittest. TestCase) :
class FooTests(
def setUp(self):
pass
def test_foo(self):
print 'foo'
def test_bar(self):
print 'bar'
unittest.main()
```
Result:
``` ------- ------- ------- ------- ------- ------- ------- ------- -------
bar
.foo
.
-------
Ran 2 tests in 0.000s
```
On Thu, 24 Dec 2015 at 19:25 Robert Collins <email address hidden>
wrote:
> I thought the decorators did work on classes? They do in unittest which /bugs.launchpad .net/bugs/ 1529047 /bugs.launchpad .net/testtools/ +bug/1529047/ +subscriptions
> we largely derive from.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https:/
>
> Title:
> Skipping all tests in a class is awkward
>
> To manage notifications about this bug go to:
> https:/
>