Skip to content

Commit 6b9dede

Browse files
committed
test(datetime): group timestamp_to_nanos tests together
1 parent df3ba96 commit 6b9dede

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/utils/test_datetime.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ def test_timestamp_to_nanos(timestamp: str, nanos: int) -> None:
118118
assert nanos == timestamp_to_nanos(timestamp)
119119

120120

121+
def test_timestamp_to_nanos_unexpected_zone_offset() -> None:
122+
with pytest.raises(ValueError, match="Zone offset provided, but not expected: 2025-02-23T16:21:44.375612001-04:00"):
123+
timestamp_to_nanos("2025-02-23T16:21:44.375612001-04:00")
124+
125+
121126
@pytest.mark.parametrize(
122127
"timestamp, nanos",
123128
[
@@ -135,11 +140,6 @@ def test_timestamptz_to_nanos_missing_zone_offset() -> None:
135140
timestamptz_to_nanos("2025-02-23T20:21:44.375612001")
136141

137142

138-
def test_timestamp_to_nanos_unexpected_zone_offset() -> None:
139-
with pytest.raises(ValueError, match="Zone offset provided, but not expected: 2025-02-23T16:21:44.375612001-04:00"):
140-
timestamp_to_nanos("2025-02-23T16:21:44.375612001-04:00")
141-
142-
143143
@pytest.mark.parametrize("nanos, micros", [(1510871468000001001, 1510871468000001), (-1510871468000001001, -1510871468000002)])
144144
def test_nanos_to_micros(nanos: int, micros: int) -> None:
145145
assert micros == nanos_to_micros(nanos)

0 commit comments

Comments
 (0)