def setUp(self): super(MemorymemprofileTestCase, self).setUp() self.flags(healthnmon_log_dir='.') self.path_to_file = 'healthnmon_memprofile.hpy' profile_mem.hpy = FakeGuppy.hpy self.h = profile_mem.hpy() profile_mem.setref = False
def test_initiliaze_memprofile(self): profile_mem.h = profile_mem.hpy() def example_method(arg1, arg2): return arg1 + arg2 decorator_method = profile_mem.profile_memory_decorator( 'example_method', example_method) profile_mem.modules_profiling_status['example_method'] = True rt = decorator_method(1, 2) self.assertEqual(3, rt)