Skip to content

Commit

Permalink
Fix issue with CustomEvents on py311
Browse files Browse the repository at this point in the history
  • Loading branch information
vfdev-5 committed Apr 26, 2023
1 parent 36a28c5 commit 6009916
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/ignite/engine/test_custom_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ def test_deprecated_callable_events_class():
class CustomEvents(CallableEvents, Enum):
TEST_EVENT = "test_event"

def __new__(cls, value: str) -> "CallableEvents":
obj = CallableEvents.__new__(cls)
obj._value_ = value
return obj

with pytest.raises(TypeError, match=r"Value at \d of event_names should be a str or EventEnum"):
engine.register_events(*CustomEvents)

Expand Down

0 comments on commit 6009916

Please sign in to comment.