event-bus
event-bus copied to clipboard
Resetting `bus` to the initial state
This PR aims to improve test reliability of test test_suscribed_event_was_removed
by resetting bus
to the initial state by calling EventBus.add_event
The test can fail in this way by running pip3 install pytest-repeat; python3 -m pytest --count=2 tests/test_subscribed_removal.py::test_suscribed_event_was_removed
:
if self._events[event] == event_funcs_copy:
err_msg = "function doesn't exist inside event {} ".format(event)
> raise EventDoesntExist(err_msg)
E event_bus.exceptions.EventDoesntExist: function doesn't exist inside event event
It may be better to clean state pollutions so that some other tests won't fail in the future due to the shared state pollution.