Open Klavionik opened 1 month ago
I am planning a big TestClient refactor, but now we should complete all production usecases to move forward, sorry, I add it to backlog (and big thanks for the report)
Btw, why are you not in the RU telegram group yet?
No worries, I don't expect every issue to be fixed in hours. :)
Btw, why are you not in the RU telegram group yet?
I enjoy reporting issues.
Describe the bug I'm not really sure if this is a bug or not. If it's not a bug but an intended behaviour, then I suppose it should be at least mentioned in the docs.
Right now, if you start the broker and then try to patch it with the in-memory broker for testing purposes, call count assertions will fail (at least when testing a publisher).
It may seem obvious to someone, but I've spent quite some time trying to figure out the problem. Connecting a broker before running tests didn't seem like the problem: what if I wish to run tests both in-memory and with a real thing, so why not making a connection beforehand?
How to reproduce Consider this example code:
Running this test would lead to
AssertionError: assert 0 == 10
. However, if you removeawait broker.start()
call from the broker provider method, it works fine.Expected behavior In-memory broker works even if the broker has established the connection.
Observed behavior In-memory broker doesn't register
publish
calls if it has established the connection before patching.Environment
Running FastStream 0.5.7 with CPython 3.12.0 on Darwin