def tearDown(self): if hasattr(self, 'pr'): p = Stats(self.profile) p.strip_dirs() p.sort_stats('cumtime') p.print_stats() del self.level_stats