You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I create a TestRabbitBroker in a fixture, and then add a subscriber. This subscriber is still available in the next test. As the fixture is function scoped, so on every call this means that the subscriber is added to the real broker.
One can work around this by creating the broker in a factory method.
How to reproduce
Install pytest + faststream[rabbit] save source as 'test_bug.pythen runpytest`
Well, TestClient patches the original broker indeed. And it doesn't make it in a clearest way. Seems like I have to refactor all test class logic and implementation and it can't be a fast fix, sorry.
The behavior of this test case has changed. I can no longer add new subscribers after TestRabbitBroker has been called, instead I need to add them before creating the TestRabbitBroker.
However: This is an annoying issue, not actually a critical one.
Describe the bug
If I create a TestRabbitBroker in a fixture, and then add a subscriber. This subscriber is still available in the next test. As the fixture is function scoped, so on every call this means that the subscriber is added to the real broker.
One can work around this by creating the broker in a factory method.
How to reproduce
Install
pytest + faststream[rabbit]
save source as 'test_bug.pythen run
pytest`Environment
Include the output of the
faststream -v
command to display your current project and system environment.The text was updated successfully, but these errors were encountered: