Skip to content

Commit

Permalink
Fix naturaldelta tests with missing timezone info
Browse files Browse the repository at this point in the history
  • Loading branch information
phijor committed Oct 1, 2020
1 parent 5d99206 commit 2b7b018
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/test_time.py
Expand Up @@ -349,13 +349,14 @@ def test_naturaldelta_when_explicit(test_input, when, expected):
"value, when",
[
(NOW_UTC, None),
(NOW_UTC, NOW_UTC_PLUS_01_00),
(NOW_UTC_PLUS_01_00, NOW_UTC),
(NOW_UTC, NOW),
(NOW_UTC_PLUS_01_00, None),
(NOW_UTC_PLUS_01_00, NOW),
],
)
def test_naturaldelta_when_mixed_timezones(value, when):
"""Mixed timezones on `value` and `when` should lead to a `TypeError`,
since subtraction `when - value` is not defined by the `datetime` module.
def test_naturaldelta_when_missing_tzinfo(value, when):
"""Subtraction `when - value` is not defined by the `datetime` module when
either operand has not timezone-info (`tz=None`) and raises a TypeError.
"""

# Act / Assert
Expand Down

0 comments on commit 2b7b018

Please sign in to comment.