Skip to content

Instantly share code, notes, and snippets.



Created May 28, 2011
What would you like to do?
Decorator to mark tests as work in progress for Python's Nose testing framework
from functools import wraps
from nose.plugins.attrib import attr
from nose.plugins.skip import SkipTest
def fail(message):
raise AssertionError(message)
def wip(f):
def run_test(*args, **kwargs):
f(*args, **kwargs)
except Exception as e:
raise SkipTest("WIP test failed: " + str(e))
fail("test passed but marked as work in progress")
return attr('wip')(run_test)

This comment has been minimized.

Copy link

@ninowalker ninowalker commented Sep 25, 2012

Thanks for this :)


This comment has been minimized.

Copy link

@catermelon catermelon commented Dec 21, 2012

This is awesome - I am totes stealing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment