Advertisement
Guest User

pytest output

a guest
Feb 4th, 2024
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.16 KB | Software | 0 0
  1. ============================= test session starts ==============================
  2. platform linux -- Python 3.12.1, pytest-7.4.4, pluggy-1.4.0
  3. rootdir: /home/duranda/devel/redis-pytest
  4. configfile: pytest.ini
  5. plugins: asyncio-0.23.4
  6. asyncio: mode=Mode.AUTO
  7. collected 2 items
  8.  
  9. test_redis.py F.E [100%]
  10.  
  11. ==================================== ERRORS ====================================
  12. _______________ ERROR at teardown of test_search_jigger_bicycle ________________
  13.  
  14. @pytest.fixture(scope="session")
  15. async def redis():
  16. redis = Redis(host="localhost", port=6379, db=0, decode_responses=True)
  17. yield redis
  18. > await redis.aclose()
  19.  
  20. test_redis.py:15:
  21. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  22. venv/lib/python3.12/site-packages/redis/asyncio/client.py:566: in aclose
  23. await self.connection_pool.disconnect()
  24. venv/lib/python3.12/site-packages/redis/asyncio/connection.py:1103: in disconnect
  25. raise exc
  26. venv/lib/python3.12/site-packages/redis/asyncio/connection.py:386: in disconnect
  27. self._writer.close() # type: ignore[union-attr]
  28. /usr/lib/python3.12/asyncio/streams.py:355: in close
  29. return self._transport.close()
  30. /usr/lib/python3.12/asyncio/selector_events.py:1206: in close
  31. super().close()
  32. /usr/lib/python3.12/asyncio/selector_events.py:871: in close
  33. self._loop.call_soon(self._call_connection_lost, None)
  34. /usr/lib/python3.12/asyncio/base_events.py:792: in call_soon
  35. self._check_closed()
  36. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  37.  
  38. self = <_UnixSelectorEventLoop running=False closed=True debug=False>
  39.  
  40. def _check_closed(self):
  41. if self._closed:
  42. > raise RuntimeError('Event loop is closed')
  43. E RuntimeError: Event loop is closed
  44.  
  45. /usr/lib/python3.12/asyncio/base_events.py:539: RuntimeError
  46. =================================== FAILURES ===================================
  47. ___________________________ test_search_all_bicycles ___________________________
  48.  
  49. bicycles = None
  50. bicycle_idx = <redis.commands.search.AsyncSearch object at 0x7fe07f055d60>
  51. redis = Redis<ConnectionPool<Connection<host=localhost,port=6379,db=0>>>
  52.  
  53. async def test_search_all_bicycles(bicycles, bicycle_idx: AsyncSearch, redis: Redis):
  54. > res = await bicycle_idx.search(Query("*"))
  55.  
  56. test_redis.py:94:
  57. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  58. venv/lib/python3.12/site-packages/redis/commands/search/commands.py:928: in search
  59. res = await self.execute_command(SEARCH_CMD, *args)
  60. venv/lib/python3.12/site-packages/redis/asyncio/client.py:606: in execute_command
  61. return await conn.retry.call_with_retry(
  62. venv/lib/python3.12/site-packages/redis/asyncio/retry.py:59: in call_with_retry
  63. return await do()
  64. venv/lib/python3.12/site-packages/redis/asyncio/client.py:580: in _send_command_parse_response
  65. return await self.parse_response(conn, command_name, **options)
  66. venv/lib/python3.12/site-packages/redis/asyncio/client.py:627: in parse_response
  67. response = await connection.read_response()
  68. venv/lib/python3.12/site-packages/redis/asyncio/connection.py:510: in read_response
  69. response = await self._parser.read_response(
  70. venv/lib/python3.12/site-packages/redis/_parsers/resp2.py:82: in read_response
  71. response = await self._read_response(disable_decoding=disable_decoding)
  72. venv/lib/python3.12/site-packages/redis/_parsers/resp2.py:90: in _read_response
  73. raw = await self._readline()
  74. venv/lib/python3.12/site-packages/redis/_parsers/base.py:219: in _readline
  75. data = await self._stream.readline()
  76. /usr/lib/python3.12/asyncio/streams.py:565: in readline
  77. line = await self.readuntil(sep)
  78. /usr/lib/python3.12/asyncio/streams.py:657: in readuntil
  79. await self._wait_for_data('readuntil')
  80. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  81.  
  82. self = <StreamReader transport=<_SelectorSocketTransport closing fd=17 read=idle write=<idle, bufsize=0>>>
  83. func_name = 'readuntil'
  84.  
  85. async def _wait_for_data(self, func_name):
  86. """Wait until feed_data() or feed_eof() is called.
  87.  
  88. If stream was paused, automatically resume it.
  89. """
  90. # StreamReader uses a future to link the protocol feed_data() method
  91. # to a read coroutine. Running two read coroutines at the same time
  92. # would have an unexpected behaviour. It would not possible to know
  93. # which coroutine would get the next data.
  94. if self._waiter is not None:
  95. raise RuntimeError(
  96. f'{func_name}() called while another coroutine is '
  97. f'already waiting for incoming data')
  98.  
  99. assert not self._eof, '_wait_for_data after EOF'
  100.  
  101. # Waiting for data while paused will make deadlock, so prevent it.
  102. # This is essential for readexactly(n) for case when n > self._limit.
  103. if self._paused:
  104. self._paused = False
  105. self._transport.resume_reading()
  106.  
  107. self._waiter = self._loop.create_future()
  108. try:
  109. > await self._waiter
  110. 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
  111.  
  112. /usr/lib/python3.12/asyncio/streams.py:542: RuntimeError
  113. =============================== warnings summary ===============================
  114. test_redis.py::test_search_all_bicycles
  115. /home/duranda/devel/redis-pytest/venv/lib/python3.12/site-packages/pytest_asyncio/plugin.py:656: DeprecationWarning: There is no current event loop
  116. old_loop = asyncio.get_event_loop()
  117.  
  118. -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
  119. =========================== short test summary info ============================
  120. FAILED test_redis.py::test_search_all_bicycles - RuntimeError: Task <Task pen...
  121. ERROR test_redis.py::test_search_jigger_bicycle - RuntimeError: Event loop is...
  122. =============== 1 failed, 1 passed, 1 warning, 1 error in 0.17s ================
  123.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement