mirror of
https://github.com/kennethreitz/maya.git
synced 2026-06-05 14:50:19 +00:00
number of frozen_now variants narrowed to speed up tests
This commit is contained in:
+15
-16
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user