Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitarOnGithub committed Jul 8, 2024
1 parent 335eb75 commit f661acb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
from sys import version_info
from datetime import time, date, datetime
from periods.utils import get_datetime, _test_pattern, _test_defaults, _convert_to_type, convert_to_datetime

Expand Down Expand Up @@ -50,8 +51,10 @@ def test_time_defaults(self):
# Time
self.valid_time = '15:30:11'
assert isinstance(_test_defaults(self.valid_time), time)
self.valid_time_tz = '15:30:11-0700'
assert isinstance(_test_defaults(self.valid_time_tz), time)
if version_info.minor > 10:
# Only available starting 3.11 onwards
self.valid_time_tz = '15:30:11-0700'
assert isinstance(_test_defaults(self.valid_time_tz), time)
self.invalid_time = '01:15 PM'
assert _test_defaults(self.invalid_time) is None

Expand Down

0 comments on commit f661acb

Please sign in to comment.