class Test(unittest.TestCase):

    def testSomething(self):
        self.DoSomethingIDontCareAbout()
param = 'whatever'
cProfile.runctx('self.RunFunctionIThinkIsSlow(param)', globals(), locals(),
    'myProfilingFile.pstats')
self.AssertSomeStuff()
How to profile my code?