Skip to content

Instantly share code, notes, and snippets.

@npryce

npryce/wip.py

Created May 28, 2011
Embed
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):
@wraps(f)
def run_test(*args, **kwargs):
try:
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)
@ninowalker

This comment has been minimized.

Copy link

@ninowalker ninowalker commented Sep 25, 2012

Thanks for this :)

@catermelon

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