Skip to content

Commit 00c66f2

Browse files
committed
Fix time handling in tests
1 parent 940a70b commit 00c66f2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.gitlab-ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ image: python:3.7
44
tox:
55
stage: test
66
before_script:
7-
- ln -sf /usr/share/zoneinfo/Etc/GMT+1 /etc/localtime
87
- pip install tox
98
script:
109
- tox

tests/test_rendered.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import shutil
2+
import time
23
from filecmp import dircmp
34
from pathlib import Path
45

@@ -23,12 +24,16 @@ def check_same_dirs(left, right):
2324
)
2425
assert (
2526
not comp.funny_files
26-
), "could not compare files on {} and {}".format(left, right)
27+
), "could not compare files on {} and {}".format(
28+
left, right
29+
)
2730
for subdir in comp.subdirs:
2831
to_compare.append((left / subdir, right / subdir))
2932

3033

31-
@pytest.mark.freeze_time("2019-01-20T12:34:56", tz_offset=1)
34+
@pytest.mark.freeze_time(
35+
"2019-01-20T12:34:56", tz_offset=time.timezone // 3600
36+
)
3237
def test_rendered(case_path):
3338
expected_path = case_path / "expected"
3439
output_path = case_path / "output"

0 commit comments

Comments
 (0)