MCPcopy Index your code
hub / github.com/python/cpython / test_load_equivalent_to_init

Method test_load_equivalent_to_init

Lib/test/test_pstats.py:58–68  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

56 os.remove(temp_storage_new.name)
57
58 def test_load_equivalent_to_init(self):
59 stats = pstats.Stats()
60 self.temp_storage = tempfile.NamedTemporaryFile(delete=False)
61 try:
62 cProfile.run('import os', filename=self.temp_storage.name)
63 stats.load_stats(self.temp_storage.name)
64 created = pstats.Stats(self.temp_storage.name)
65 self.assertEqual(stats.stats, created.stats)
66 finally:
67 self.temp_storage.close()
68 os.remove(self.temp_storage.name)
69
70 def test_loading_wrong_types(self):
71 stats = pstats.Stats()

Callers

nothing calls this directly

Calls 5

load_statsMethod · 0.95
runMethod · 0.45
assertEqualMethod · 0.45
closeMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected