forked from p15670423/monkey
UT: Use new Publisher for each test instead of default `pub`
Using the default publisher provided by pypubsub causes state to be carried over between tests. Unit tests should not depend on eachother or the order in which they're run.
This commit is contained in:
parent
68dafbfb9d
commit
3384c049a4
|
@ -4,7 +4,7 @@ from typing import FrozenSet, Union
|
|||
from uuid import UUID
|
||||
|
||||
import pytest
|
||||
from pubsub import pub
|
||||
from pubsub.core import Publisher
|
||||
|
||||
from common.event_queue.pypubsub_event_queue import PyPubSubEventQueue
|
||||
from common.events import AbstractEvent
|
||||
|
@ -49,7 +49,7 @@ def subscriber():
|
|||
|
||||
@pytest.fixture
|
||||
def event_queue():
|
||||
return PyPubSubEventQueue(pub)
|
||||
return PyPubSubEventQueue(Publisher())
|
||||
|
||||
|
||||
def test_subscribe_all(event_queue, subscriber):
|
||||
|
|
Loading…
Reference in New Issue