Skip to content

Commit

Permalink
Capture the warning emitted when timestamp is provided but timestamp …
Browse files Browse the repository at this point in the history
…pattern is not
  • Loading branch information
dagardner-nv committed Dec 19, 2023
1 parent 0d1fa37 commit da692e8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/modules/test_payload_batcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@ def test_custom_params(config,
expected_count,
expected_exception):

expected_warning = False
if timestamp_column_name:
filter_probs_df["timestamp"] = TIMESTAMPS
expected_warning = timestamp_pattern is None

pipe = Pipeline(config)

Expand Down Expand Up @@ -182,6 +184,10 @@ def test_custom_params(config,
if expected_exception:
with pytest.raises(type(expected_exception), match=str(expected_exception)):
pipe.run()
elif expected_warning:
with pytest.warns(UserWarning):
pipe.run()
assert len(sink_stage.get_messages()) == expected_count
else:
pipe.run()
assert len(sink_stage.get_messages()) == expected_count
Expand Down

0 comments on commit da692e8

Please sign in to comment.