Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed failing test on engine that does not warn #3196

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions tests/ignite/engine/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ def limited_data_iterator():
self._test_check_triggered_events(limited_data_iterator(), max_epochs=1, epoch_length=100, exp_iter_stops=0)
self._test_check_triggered_events(limited_data_iterator(), max_epochs=10, epoch_length=10, exp_iter_stops=0)

# These tests will fail
# These tests should fail
with pytest.raises(AssertionError):
with pytest.warns(UserWarning, match=r"Data iterator can not provide data anymore"):
self._test_check_triggered_events(limited_data_iterator(), max_epochs=3, epoch_length=100)
Expand All @@ -649,8 +649,10 @@ def limited_data_iterator():
self._test_check_triggered_events(limited_data_iterator(), max_epochs=3, epoch_length=75)

with pytest.raises(AssertionError):
with pytest.warns(UserWarning, match=r"Data iterator can not provide data anymore"):
self._test_check_triggered_events(limited_data_iterator(), max_epochs=1, epoch_length=101)
# Below test does not raise "Data iterator can not provide data anymore" warning as the last
# epoch is equal max_epochs
# with pytest.warns(UserWarning, match=r"Data iterator can not provide data anymore"):
self._test_check_triggered_events(limited_data_iterator(), max_epochs=1, epoch_length=101)

def test_run_check_triggered_events_on_iterator(self):
self._test_run_check_triggered_events_on_iterator()
Expand Down