Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def test_conncetion_reject(event_loop):
with pytest.raises(ConnectionError):
await aiormq.connect(
"amqp://guest:guest@127.0.0.1:59999/", loop=event_loop
)
connection = aiormq.Connection(
"amqp://guest:guest@127.0.0.1:59999/", loop=event_loop
)
with pytest.raises(ConnectionError):
await event_loop.create_task(connection.connect())
async def _make_connection(self, **kwargs) -> aiormq.Connection:
connection = await aiormq.connect(self.url, **kwargs)
connection.closing.add_done_callback(
partial(self._on_connection_close, self.connection)
)
return connection