event-bus icon indicating copy to clipboard operation
event-bus copied to clipboard

Resetting `bus` to the initial state

Open sturmianseq opened this issue 3 years ago • 0 comments

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.

sturmianseq avatar Aug 29 '21 03:08 sturmianseq