Lines Matching refs:self
24 def tearDown(self):
27 def get_expected_output(self):
51 def test_cprofile(self):
52 results = self.do_profiling()
53 expected = self.get_expected_output()
54 self.assertEqual(results[0], 1000)
56 for i, method in enumerate(self.methodnames):
61 f"{self.profilerclass.__name__} "
66 self.fail("\n".join(fail))
68 def test_calling_conventions(self):
81 prof = self.profilerclass(timer, 0.001)
86 self.assertIn(self.expected_max_output, res,
89 def test_run(self):
91 self.profilermodule.run("int('1')")
92 self.profilermodule.run("int('1')", filename=TESTFN)
93 self.assertTrue(os.path.exists(TESTFN))
95 def test_runctx(self):
97 self.profilermodule.runctx("testfunc()", globals(), locals())
98 self.profilermodule.runctx("testfunc()", globals(), locals(),
100 self.assertTrue(os.path.exists(TESTFN))
102 def test_run_profile_as_module(self):
104 assert_python_failure('-m', self.profilermodule.__name__, '-m')
107 assert_python_failure('-m', self.profilermodule.__name__,
111 assert_python_ok('-m', self.profilermodule.__name__,
114 def test_output_file_when_changing_directory(self):
121 '-m', self.profilermodule.__name__,
126 self.assertTrue(os.path.exists('out.pstats'))