nose-devs/nose — Issue #378: SkipTest not handled from test generators
Author: jpellerin
Created: 2011-12-14 16:09:31+00:00
State: open

Raising SkipTest from a test generator does not skip the current test, as
expected. Instead the exception propagates up and stops all the tests.

Nose version 0.10.4

~$ cat hello.py
from nose import SkipTest
import nose.tools as NT

def test_skip_normal():
raise SkipTest("Normal skip")

def test_skip_generator():
yield NT.assert_true, True
raise SkipTest("Weird skip")

~$ nosetests -v hello.py
hello.test_skip_normal ... SKIP: Normal skip
hello.test_skip_generator(True,) ... ok
Traceback (most recent call last):
File "/home/josh/hello.py", line 9, in test_skip_generator
raise SkipTest("Weird skip")
nose.plugins.skip.SkipTest: Weird skip

Google Code Info:
Issue #: 345
Author: jleedev
Created On: 2010-06-22T20:42:41.000Z
Closed On: