Skip to content

Commit

Permalink
Use conftest.py to explicitly set the time zone for all unit tests
Browse files Browse the repository at this point in the history
pronovic committed Jan 10, 2025
1 parent db7b5c3 commit e0c2a57
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ Version 0.6.15 unreleased
* Pull in latest version of run-script-framework.
* Upgrade to poetry-dynamic-versioning v1.5.2 for minor fixes.
* Add .python-version in preferred order to support pyenv.
* Use conftest.py to explicitly set the time zone for all unit tests.

Version 0.6.14 08 Jan 2025

9 changes: 9 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import os
import time


# pylint: disable=unused-argument:
def pytest_sessionstart(session):
"""Explicitly set the UTC timezone for all tests."""
os.environ["TZ"] = "UTC"
time.tzset()

0 comments on commit e0c2a57

Please sign in to comment.