Skip to content

Commit 729aaaf

Browse files
authored
test(timestamp): add unit tests for timestamp
- Replace EN DASH with hyphen-minus for consistency - Make exception test more specific with match parameter Signed-off-by: Sarthak Tyagi <153098175+sarthak-cs@users.noreply.github.com>
1 parent e2ae725 commit 729aaaf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/unit/timestamp_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def test_from_date_max_microseconds():
8181
@pytest.mark.parametrize("bad_input", [None, [], {}, 3.14])
8282
def test_from_date_invalid_type(bad_input):
8383
"""Ensure from_date raises ValueError for invalid input types."""
84-
with pytest.raises(ValueError):
84+
with pytest.raises(ValueError, match="Invalid type for date"):
8585
Timestamp.from_date(bad_input)
8686

8787

@@ -189,7 +189,7 @@ def test_generate_with_jitter():
189189
ts = Timestamp.generate(has_jitter=True)
190190
delta = time.time() - ts.to_date().timestamp()
191191

192-
# Jitter is explicitly 38 seconds backward
192+
# Jitter is explicitly 3-8 seconds backward
193193
assert 3.0 <= delta <= 9.0
194194

195195
# Protobuf serialization tests

0 commit comments

Comments
 (0)