@@ -64,7 +64,7 @@ def setup_method(self):
6464
6565 def test_basic_timer (self ):
6666 """Test basic Timer context manager functionality."""
67- timer = Timer (silent = True )
67+ timer = Timer (verbose = False )
6868
6969 with timer :
7070 time .sleep (self .sleep_time )
@@ -75,7 +75,7 @@ def test_basic_timer(self):
7575
7676 def test_timer_return_value (self ):
7777 """Test that Timer returns self for variable assignment."""
78- with Timer (silent = True ) as timer :
78+ with Timer (verbose = False ) as timer :
7979 time .sleep (self .sleep_time )
8080
8181 assert timer .elapsed is not None
@@ -84,17 +84,17 @@ def test_timer_return_value(self):
8484 def test_timer_units (self ):
8585 """Test different time units."""
8686 # Test seconds (default)
87- with Timer (silent = True ) as timer_sec :
87+ with Timer (verbose = False ) as timer_sec :
8888 time .sleep (self .sleep_time )
8989 expected_sec = self .sleep_time
9090 assert_allclose (timer_sec .elapsed , expected_sec , atol = 0.05 , rtol = 2 )
9191
9292 # Timer always stores elapsed time in seconds regardless of display unit
93- with Timer (unit = "milliseconds" , silent = True ) as timer_ms :
93+ with Timer (unit = "milliseconds" , verbose = False ) as timer_ms :
9494 time .sleep (self .sleep_time )
9595 assert_allclose (timer_ms .elapsed , expected_sec , atol = 0.05 , rtol = 2 )
9696
97- with Timer (unit = "microseconds" , silent = True ) as timer_us :
97+ with Timer (unit = "microseconds" , verbose = False ) as timer_us :
9898 time .sleep (self .sleep_time )
9999 assert_allclose (timer_us .elapsed , expected_sec , atol = 0.05 , rtol = 2 )
100100
@@ -109,33 +109,33 @@ def test_invalid_unit(self):
109109 def test_timer_precision (self ):
110110 """Test that precision parameter is accepted (output format tested manually)."""
111111 # Just verify it doesn't crash with different precision values
112- with Timer (precision = 0 , silent = True ) as timer0 :
112+ with Timer (precision = 0 , verbose = False ) as timer0 :
113113 time .sleep (self .sleep_time )
114- with Timer (precision = 6 , silent = True ) as timer6 :
114+ with Timer (precision = 6 , verbose = False ) as timer6 :
115115 time .sleep (self .sleep_time )
116116
117117 assert timer0 .elapsed is not None
118118 assert timer6 .elapsed is not None
119119
120120 def test_timer_message (self ):
121121 """Test custom message parameter (output format tested manually)."""
122- with Timer (message = "Test operation" , silent = True ) as timer :
122+ with Timer (message = "Test operation" , verbose = False ) as timer :
123123 time .sleep (self .sleep_time )
124124
125125 assert timer .elapsed is not None
126126
127- def test_timer_silent_mode (self ):
128- """Test silent mode suppresses output."""
129- # This mainly tests that silent=True doesn't crash
127+ def test_timer_verbose_mode (self ):
128+ """Test verbose mode controls output."""
129+ # This mainly tests that verbose=False doesn't crash
130130 # Output suppression is hard to test automatically
131- with Timer (silent = True ) as timer :
131+ with Timer (verbose = False ) as timer :
132132 time .sleep (self .sleep_time )
133133
134134 assert timer .elapsed is not None
135135
136136 def test_timer_exception_handling (self ):
137137 """Test that Timer works correctly even when exceptions occur."""
138- timer = Timer (silent = True )
138+ timer = Timer (verbose = False )
139139
140140 try :
141141 with timer :
@@ -153,7 +153,7 @@ def test_timeit_basic(self):
153153 def test_func ():
154154 time .sleep (self .sleep_time )
155155
156- result = timeit (test_func , runs = 3 , silent = True , results = True )
156+ result = timeit (test_func , runs = 3 , verbose = False , results = True )
157157
158158 # Check that we have results
159159 assert 'elapsed' in result
@@ -177,7 +177,7 @@ def test_func_with_args(sleep_time, multiplier=1):
177177
178178 # Use lambda to bind arguments
179179 func_with_args = lambda : test_func_with_args (self .sleep_time , 0.5 )
180- result = timeit (func_with_args , runs = 2 , silent = True , results = True )
180+ result = timeit (func_with_args , runs = 2 , verbose = False , results = True )
181181
182182 # Check results
183183 assert len (result ['elapsed' ]) == 2
@@ -214,7 +214,7 @@ def test_timeit_single_run(self):
214214 def test_func ():
215215 time .sleep (self .sleep_time )
216216
217- result = timeit (test_func , runs = 1 , silent = True , results = True )
217+ result = timeit (test_func , runs = 1 , verbose = False , results = True )
218218
219219 assert len (result ['elapsed' ]) == 1
220220 assert result ['average' ] == result ['elapsed' ][0 ]
@@ -226,12 +226,12 @@ def test_timeit_different_units(self):
226226 def test_func ():
227227 time .sleep (self .sleep_time )
228228
229- # Test milliseconds (silent mode to avoid output during tests)
230- result_ms = timeit (test_func , runs = 2 , unit = "milliseconds" , silent = True , results = True )
229+ # Test milliseconds (verbose=False to avoid output during tests)
230+ result_ms = timeit (test_func , runs = 2 , unit = "milliseconds" , verbose = False , results = True )
231231 assert len (result_ms ['elapsed' ]) == 2
232232
233233 # Test microseconds
234- result_us = timeit (test_func , runs = 2 , unit = "microseconds" , silent = True , results = True )
234+ result_us = timeit (test_func , runs = 2 , unit = "microseconds" , verbose = False , results = True )
235235 assert len (result_us ['elapsed' ]) == 2
236236
237237 # All results should be in seconds regardless of display unit
@@ -246,7 +246,7 @@ def test_func():
246246 time .sleep (self .sleep_time )
247247
248248 # This test is mainly to ensure stats_only doesn't crash
249- result = timeit (test_func , runs = 2 , stats_only = True , silent = True , results = True )
249+ result = timeit (test_func , runs = 2 , stats_only = True , verbose = False , results = True )
250250 assert len (result ['elapsed' ]) == 2
251251
252252 def test_timeit_invalid_timer_kwargs (self ):
@@ -291,19 +291,3 @@ def test_func():
291291 assert 'elapsed' in result2
292292 assert len (result2 ['elapsed' ]) == 2
293293
294- def test_timeit_backward_compatibility (self ):
295- """Test that existing silent parameter still works."""
296- def test_func ():
297- time .sleep (self .sleep_time )
298-
299- # Test that silent=True still suppresses output
300- result = timeit (test_func , runs = 2 , silent = True , results = True )
301- assert result is not None
302- assert len (result ['elapsed' ]) == 2
303-
304- # Test interaction between verbose and silent
305- # silent=True should override verbose=True
306- result2 = timeit (test_func , runs = 2 , verbose = True , silent = True , results = True )
307- assert result2 is not None
308- assert len (result2 ['elapsed' ]) == 2
309-
0 commit comments