number of frozen_now variants narrowed to speed up tests

This commit is contained in:
Jan Vlcinsky
2018-04-01 23:48:18 +02:00
parent 59ec275ef6
commit 367dac4e62
+15 -16
View File
@@ -3,23 +3,22 @@ import pytest
@pytest.fixture(params=[
"2018-03-25T00:00:00",
"2018-03-25T01:00:00",
"2018-03-25T02:00:00",
"2018-03-25T02:30:00",
"2018-03-25T03:00:00",
"2018-03-25T04:00:00",
])
def now_string(request):
return request.param
("2018-03-25T00:00:00", 2),
("2018-03-25T01:00:00", 2),
("2018-03-25T02:00:00", 2),
("2018-03-25T02:30:00", 2),
("2018-03-25T03:00:00", 2),
("2018-03-25T04:00:00", 2),
("2018-10-28T00:00:00", 2),
("2018-10-28T01:00:00", 2),
("2018-10-28T02:00:00", 2),
("2018-10-28T02:30:00", 2),
("2018-10-28T03:00:00", 2),
("2018-10-28T04:00:00", 2),
@pytest.fixture(params=[0, 1, 2, 3, 4, -1, -2, -3, 10, 11, -10, -11])
def tz_offset(request):
return request.param
@pytest.fixture
def frozen_now(now_string, tz_offset):
], ids=lambda x: x[0] + "_off_" + str(x[1]))
def frozen_now(request):
now_string, tz_offset = request.param
with freeze_time(now_string, tz_offset=tz_offset):
yield