Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ============================= test session starts ==============================
- platform linux -- Python 3.12.1, pytest-7.4.4, pluggy-1.4.0
- rootdir: /home/duranda/devel/redis-pytest
- configfile: pytest.ini
- plugins: asyncio-0.23.4
- asyncio: mode=Mode.AUTO
- collected 2 items
- test_redis.py F.E [100%]
- ==================================== ERRORS ====================================
- _______________ ERROR at teardown of test_search_jigger_bicycle ________________
- @pytest.fixture(scope="session")
- async def redis():
- redis = Redis(host="localhost", port=6379, db=0, decode_responses=True)
- yield redis
- > await redis.aclose()
- test_redis.py:15:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- venv/lib/python3.12/site-packages/redis/asyncio/client.py:566: in aclose
- await self.connection_pool.disconnect()
- venv/lib/python3.12/site-packages/redis/asyncio/connection.py:1103: in disconnect
- raise exc
- venv/lib/python3.12/site-packages/redis/asyncio/connection.py:386: in disconnect
- self._writer.close() # type: ignore[union-attr]
- /usr/lib/python3.12/asyncio/streams.py:355: in close
- return self._transport.close()
- /usr/lib/python3.12/asyncio/selector_events.py:1206: in close
- super().close()
- /usr/lib/python3.12/asyncio/selector_events.py:871: in close
- self._loop.call_soon(self._call_connection_lost, None)
- /usr/lib/python3.12/asyncio/base_events.py:792: in call_soon
- self._check_closed()
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- self = <_UnixSelectorEventLoop running=False closed=True debug=False>
- def _check_closed(self):
- if self._closed:
- > raise RuntimeError('Event loop is closed')
- E RuntimeError: Event loop is closed
- /usr/lib/python3.12/asyncio/base_events.py:539: RuntimeError
- =================================== FAILURES ===================================
- ___________________________ test_search_all_bicycles ___________________________
- bicycles = None
- bicycle_idx = <redis.commands.search.AsyncSearch object at 0x7fe07f055d60>
- redis = Redis<ConnectionPool<Connection<host=localhost,port=6379,db=0>>>
- async def test_search_all_bicycles(bicycles, bicycle_idx: AsyncSearch, redis: Redis):
- > res = await bicycle_idx.search(Query("*"))
- test_redis.py:94:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- venv/lib/python3.12/site-packages/redis/commands/search/commands.py:928: in search
- res = await self.execute_command(SEARCH_CMD, *args)
- venv/lib/python3.12/site-packages/redis/asyncio/client.py:606: in execute_command
- return await conn.retry.call_with_retry(
- venv/lib/python3.12/site-packages/redis/asyncio/retry.py:59: in call_with_retry
- return await do()
- venv/lib/python3.12/site-packages/redis/asyncio/client.py:580: in _send_command_parse_response
- return await self.parse_response(conn, command_name, **options)
- venv/lib/python3.12/site-packages/redis/asyncio/client.py:627: in parse_response
- response = await connection.read_response()
- venv/lib/python3.12/site-packages/redis/asyncio/connection.py:510: in read_response
- response = await self._parser.read_response(
- venv/lib/python3.12/site-packages/redis/_parsers/resp2.py:82: in read_response
- response = await self._read_response(disable_decoding=disable_decoding)
- venv/lib/python3.12/site-packages/redis/_parsers/resp2.py:90: in _read_response
- raw = await self._readline()
- venv/lib/python3.12/site-packages/redis/_parsers/base.py:219: in _readline
- data = await self._stream.readline()
- /usr/lib/python3.12/asyncio/streams.py:565: in readline
- line = await self.readuntil(sep)
- /usr/lib/python3.12/asyncio/streams.py:657: in readuntil
- await self._wait_for_data('readuntil')
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- self = <StreamReader transport=<_SelectorSocketTransport closing fd=17 read=idle write=<idle, bufsize=0>>>
- func_name = 'readuntil'
- async def _wait_for_data(self, func_name):
- """Wait until feed_data() or feed_eof() is called.
- If stream was paused, automatically resume it.
- """
- # StreamReader uses a future to link the protocol feed_data() method
- # to a read coroutine. Running two read coroutines at the same time
- # would have an unexpected behaviour. It would not possible to know
- # which coroutine would get the next data.
- if self._waiter is not None:
- raise RuntimeError(
- f'{func_name}() called while another coroutine is '
- f'already waiting for incoming data')
- assert not self._eof, '_wait_for_data after EOF'
- # Waiting for data while paused will make deadlock, so prevent it.
- # This is essential for readexactly(n) for case when n > self._limit.
- if self._paused:
- self._paused = False
- self._transport.resume_reading()
- self._waiter = self._loop.create_future()
- try:
- > await self._waiter
- E RuntimeError: Task <Task pending name='Task-5' coro=<test_search_all_bicycles() running at /home/duranda/devel/redis-pytest/test_redis.py:94> cb=[_run_until_complete_cb() at /usr/lib/python3.12/asyncio/base_events.py:180]> got Future <Future pending> attached to a different loop
- /usr/lib/python3.12/asyncio/streams.py:542: RuntimeError
- =============================== warnings summary ===============================
- test_redis.py::test_search_all_bicycles
- /home/duranda/devel/redis-pytest/venv/lib/python3.12/site-packages/pytest_asyncio/plugin.py:656: DeprecationWarning: There is no current event loop
- old_loop = asyncio.get_event_loop()
- -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
- =========================== short test summary info ============================
- FAILED test_redis.py::test_search_all_bicycles - RuntimeError: Task <Task pen...
- ERROR test_redis.py::test_search_jigger_bicycle - RuntimeError: Event loop is...
- =============== 1 failed, 1 passed, 1 warning, 1 error in 0.17s ================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement