Skip to content

Commit

Permalink
Test Clock: Fix timezone offset
Browse files Browse the repository at this point in the history
This was previously removed, and now this test seems to depend on the
environment it is being ran (?). This adds back the UTC offset of the
timezone such that the delta is taken into account. Fixes qtile#4762
  • Loading branch information
jwijenbergh committed Apr 14, 2024
1 parent 2716aa6 commit a890670
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/widgets/test_clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ class MockDatetime(datetime.datetime):
def now(cls, *args, **kwargs):
return cls(2021, 1, 1, 10, 20, 30)

def astimezone(self, tzone=None):
if tzone is None:
return self
return self + tzone.utcoffset(None)


@pytest.fixture
def patched_clock(monkeypatch):
Expand Down

0 comments on commit a890670

Please sign in to comment.