@@ -266,53 +266,15 @@ async def test_timer_construction_custom_args() -> None:
266266 assert timer .is_running is True
267267
268268
269- async def test_timer_construction_timeout_custom_args () -> None :
270- """Test the construction of a timeout timer with custom arguments."""
271- timer = Timer .timeout (
272- timedelta (seconds = 5.0 ),
273- auto_start = True ,
274- loop = None ,
275- )
276- assert timer .interval == timedelta (seconds = 5.0 )
277- assert isinstance (timer .missed_tick_policy , SkipMissedAndDrift )
278- assert timer .missed_tick_policy .delay_tolerance == timedelta (0 )
279- assert timer .loop is asyncio .get_running_loop ()
280- assert timer .is_running is True
281-
282-
283- async def test_timer_construction_periodic_defaults () -> None :
284- """Test the construction of a periodic timer."""
285- timer = Timer .periodic (timedelta (seconds = 5.0 ))
286- assert timer .interval == timedelta (seconds = 5.0 )
287- assert isinstance (timer .missed_tick_policy , TriggerAllMissed )
288- assert timer .loop is asyncio .get_running_loop ()
289- assert timer .is_running is True
290-
291-
292- async def test_timer_construction_periodic_custom_args () -> None :
293- """Test the construction of a timeout timer with custom arguments."""
294- timer = Timer .periodic (
295- timedelta (seconds = 5.0 ),
296- skip_missed_ticks = True ,
297- auto_start = True ,
298- start_delay = timedelta (seconds = 1.0 ),
299- loop = None ,
300- )
301- assert timer .interval == timedelta (seconds = 5.0 )
302- assert isinstance (timer .missed_tick_policy , SkipMissedAndResync )
303- assert timer .loop is asyncio .get_running_loop ()
304- assert timer .is_running is True
305-
306-
307269async def test_timer_construction_wrong_args () -> None :
308- """Test the construction of a timeout timer with wrong arguments."""
270+ """Test the construction of a timer with wrong arguments."""
309271 with pytest .raises (
310272 ValueError ,
311273 match = "^The `interval` must be positive and at least 1 microsecond, not -1 day, 23:59:55$" ,
312274 ):
313- _ = Timer . periodic (
275+ _ = Timer (
314276 timedelta (seconds = - 5.0 ),
315- skip_missed_ticks = True ,
277+ SkipMissedAndResync () ,
316278 auto_start = True ,
317279 loop = None ,
318280 )
@@ -321,9 +283,9 @@ async def test_timer_construction_wrong_args() -> None:
321283 ValueError ,
322284 match = "^`start_delay` can't be negative, got -1 day, 23:59:59$" ,
323285 ):
324- _ = Timer . periodic (
286+ _ = Timer (
325287 timedelta (seconds = 5.0 ),
326- skip_missed_ticks = True ,
288+ SkipMissedAndResync () ,
327289 auto_start = True ,
328290 start_delay = timedelta (seconds = - 1.0 ),
329291 loop = None ,
@@ -333,9 +295,9 @@ async def test_timer_construction_wrong_args() -> None:
333295 ValueError ,
334296 match = "^`auto_start` must be `True` if a `start_delay` is specified$" ,
335297 ):
336- _ = Timer . periodic (
298+ _ = Timer (
337299 timedelta (seconds = 5.0 ),
338- skip_missed_ticks = True ,
300+ SkipMissedAndResync () ,
339301 auto_start = False ,
340302 start_delay = timedelta (seconds = 1.0 ),
341303 loop = None ,
0 commit comments