mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #5633: Fixed timeit when the statement is a string and the setup is not.
Refactored timeit.__init__ for unified handling of stmt and setup parameters.
This commit is contained in:
commit
1b560cbf85
3 changed files with 29 additions and 33 deletions
|
@ -124,6 +124,9 @@ class TestTimeit(unittest.TestCase):
|
|||
def test_timeit_callable_stmt(self):
|
||||
self.timeit(self.fake_callable_stmt, self.fake_setup, number=3)
|
||||
|
||||
def test_timeit_callable_setup(self):
|
||||
self.timeit(self.fake_stmt, self.fake_callable_setup, number=3)
|
||||
|
||||
def test_timeit_callable_stmt_and_setup(self):
|
||||
self.timeit(self.fake_callable_stmt,
|
||||
self.fake_callable_setup, number=3)
|
||||
|
@ -184,6 +187,10 @@ class TestTimeit(unittest.TestCase):
|
|||
self.repeat(self.fake_callable_stmt, self.fake_setup,
|
||||
repeat=3, number=5)
|
||||
|
||||
def test_repeat_callable_setup(self):
|
||||
self.repeat(self.fake_stmt, self.fake_callable_setup,
|
||||
repeat=3, number=5)
|
||||
|
||||
def test_repeat_callable_stmt_and_setup(self):
|
||||
self.repeat(self.fake_callable_stmt, self.fake_callable_setup,
|
||||
repeat=3, number=5)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue