Skip to content

Instantly share code, notes, and snippets.

View markomanninen's full-sized avatar

Marko Manninen markomanninen

View GitHub Profile
@jiffyclub
jiffyclub / runtests.py
Created November 4, 2012 20:28
An IPython %runtests magic that does some very basic test function discovery, running, and reporting within IPython.
from IPython.core.magic import register_line_magic
@register_line_magic
def runtests(line):
"""
The %runtests magic searches your IPython namespace for functions
with names that begin with 'test'. It will attempt to run these
functions (calling them with no arguments), and report whether they
pass, fail (raise an AssertionError), or error (raise any other