docs.python.org/2/library/sys.html#sys.settrace
Trace Lines/Calls/Returns
for a certain value of "practical"
def add(x, y):
z = x + y
return z
def subtract(x, y):
z = x - y
return z
def test_add():
assert 1 == worker.add(1, 0)
def test_add___negative():
assert 0 == worker.add(-1, 1)
def test_subtract():
assert 0 == worker.subtract(0, 0)
def add(x, y):
z = x + y # test_add, test_add_negative
return z # test_add, test_add_negative
def subtract(x, y):
z = x - y # test_subtract
return z # test_subtract
nosetests --with-nostrils --nostrils-whitelist=xyz
Official Python doc
https://docs.python.org/2/library/sys.html#sys.settrace
Python-Aware Python (Ned Batchelder PyCON2011)
http://pyvideo.org/video/447/pycon-2011--python-aware-python
nostrils nose plugin