I have a python nose test function
def test_foo():
a = 1
b = 2
and I want to get the source code as string("\ta = 1\n\tb =2") in my customized plugin. I try
def startTest(self, test):
print inspect.getsource(test)
Above code cannot work. How to make it work?