Skip to content

Commit 9fe7672

Browse files
agoscinskisphuber
authored andcommitted
Tests: Remove test for make_aware using fixed date
The test compares the timezones between a fixed date and of the current date. This causes problem with time zones that use daylight saving time (DST). Fixing the test makes would add too much complexity for what the test is actually covering. The `make_aware` function is still thoroughly tested by the remaining tests.
1 parent f575916 commit 9fe7672

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

tests/common/test_timezone.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,6 @@ def test_now():
4040
assert from_tz >= ref - dt
4141

4242

43-
def test_make_aware():
44-
"""Test the :func:`aiida.common.timezone.make_aware` function.
45-
46-
This should make a naive datetime object aware using the timezone of the operating system.
47-
"""
48-
system_tzinfo = datetime.now(timezone.utc).astimezone() # This is how to get the timezone of the OS.
49-
naive = datetime(1970, 1, 1)
50-
aware = make_aware(naive)
51-
assert is_aware(aware)
52-
assert aware.tzinfo.tzname(aware) == system_tzinfo.tzname()
53-
assert aware.tzinfo.utcoffset(aware) == system_tzinfo.utcoffset()
54-
55-
5643
def test_make_aware_already_aware():
5744
"""Test the :func:`aiida.common.timezone.make_aware` function for an already aware datetime.
5845

0 commit comments

Comments
 (0)