File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
"""Simple and fast framework to create message brokers based microservices."""
2
2
3
- __version__ = "0.5.33 "
3
+ __version__ = "0.5.34 "
4
4
5
5
SERVICE_NAME = f"faststream-{ __version__ } "
Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ def _publisher_setup_extra(self) -> "AnyDict":
285
285
286
286
def publisher (self , * args : Any , ** kwargs : Any ) -> "PublisherProto[MsgType]" :
287
287
pub = super ().publisher (* args , ** kwargs )
288
- if self .running :
288
+ if self .running or self . _connection is not None :
289
289
self .setup_publisher (pub )
290
290
return pub
291
291
Original file line number Diff line number Diff line change @@ -578,6 +578,12 @@ async def handler(m):
578
578
assert event .is_set ()
579
579
assert not mock .called
580
580
581
+ @pytest .mark .asyncio
582
+ async def test_publisher_after_connect (self , queue : str ):
583
+ async with self .patch_broker (self .get_broker ()) as br :
584
+ # Should pass without error
585
+ await br .publisher (queue ).publish (None )
586
+
581
587
@pytest .mark .asyncio
582
588
async def test_publisher_after_start (
583
589
self ,
You can’t perform that action at this time.
0 commit comments