fromnose2importsessionfromnose2.pluginsimportproffromnose2.eventsimportStartTestRunEventfromnose2.tests._commonimportStub,TestCaseclassTestProfPlugin(TestCase):tags=['unit']defsetUp(self):self.plugin=prof.Profiler(session=session.Session())self.hotshot=prof.hotshotself.stats=prof.statsprof.hotshot=Stub()prof.stats=Stub()deftearDown(self):prof.hotshot=self.hotshotprof.stats=self.statsdeftest_startTestRun_sets_executeTests(self):_prof=Stub()_prof.runcall=object()prof.hotshot.Profile=lambdafilename:_profevent=StartTestRunEvent(runner=None,suite=None,result=None,startTime=None,executeTests=None)self.plugin.startTestRun(event)assertevent.executeTestsis_prof.runcall, \"executeTests was not replaced"