def setUp(self): self.patch = mock.patch.object( builtins, 'open', mock.mock_open(read_data=_TEST_FILE)) self.patch.start() program_stats = code_heatmap.CodeHeatmapProfile('foo.py').run() stats_handler = functools.partial( stats_server.StatsHandler, program_stats) self.server = stats_server.StatsServer( (_HOST, _PORT), stats_handler) threading.Thread(target=self.server.serve_forever).start()
def setUp(self): program_stats = code_heatmap.CodeHeatmapProfile(_PACKAGE_PATH).run() stats_handler = functools.partial(stats_server.StatsHandler, program_stats) self.server = stats_server.StatsServer((_HOST, _PORT), stats_handler) threading.Thread(target=self.server.serve_forever).start()