From 673adf0e129ffe974fb573a3d8282d6fc5a661da Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Tue, 16 Apr 2024 11:48:31 +0200 Subject: [PATCH] Update test_datetimes.py --- tests/test_datetimes.py | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/tests/test_datetimes.py b/tests/test_datetimes.py index 0632f9ff..b6bd75a4 100644 --- a/tests/test_datetimes.py +++ b/tests/test_datetimes.py @@ -167,28 +167,13 @@ def test_manual_increment(): with freeze_time(initial_datetime) as frozen_datetime: assert frozen_datetime() == initial_datetime - frozen_datetime.tick() - initial_datetime += datetime.timedelta(seconds=1) - assert frozen_datetime() == initial_datetime - - frozen_datetime.tick(delta=datetime.timedelta(seconds=10)) - initial_datetime += datetime.timedelta(seconds=10) - assert frozen_datetime() == initial_datetime - - -def test_manual_increment_seconds(): - initial_datetime = datetime.datetime(year=1, month=7, day=12, - hour=15, minute=6, second=3) - with freeze_time(initial_datetime) as frozen_datetime: - assert frozen_datetime() == initial_datetime + expected = initial_datetime + datetime.timedelta(seconds=1) + assert frozen_datetime.tick() == expected + assert frozen_datetime() == expected - frozen_datetime.tick() - initial_datetime += datetime.timedelta(seconds=1) - assert frozen_datetime() == initial_datetime - - frozen_datetime.tick(10) - initial_datetime += datetime.timedelta(seconds=10) - assert frozen_datetime() == initial_datetime + expected = initial_datetime + datetime.timedelta(seconds=10) + assert frozen_datetime.tick(delta=datetime.timedelta(seconds=10)) == expected + assert frozen_datetime() == expected def test_move_to():