Skip to content

Commit

Permalink
Merge pull request #12698 from ichard26/fix-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed May 14, 2024
2 parents 36a61d0 + a2b23ff commit 0d9a654
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/unit/test_base_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@

@pytest.fixture
def fixed_time() -> Iterator[None]:
with patch("time.time", lambda: 1547704837.040001 + time.timezone):
yield
# Patch time so logs contain a constant timestamp. time.time_ns is used by
# logging starting with Python 3.13.
year2019 = 1547704837.040001 + time.timezone
with patch("time.time", lambda: year2019):
with patch("time.time_ns", lambda: int(year2019 * 1e9)):
yield


class FakeCommand(Command):
Expand Down

0 comments on commit 0d9a654

Please sign in to comment.