[Python-modules-team] Bug#959532: python-nest-asyncio FTBFS: test failures
Adrian Bunk
bunk at debian.org
Sun May 3 12:16:47 BST 2020
Source: python-nest-asyncio
Version: 1.2.3-1
Severity: serious
Tags: ftbfs fixed-upstream
https://buildd.debian.org/status/package.php?p=python-nest-asyncio
...
dh_auto_test -a -O--buildsystem=pybuild
I: pybuild base:217: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build; python3.7 -m pytest tests
============================= test session starts ==============================
platform linux -- Python 3.7.7, pytest-4.6.9, py-1.8.1, pluggy-0.13.0
rootdir: /<<PKGBUILDDIR>>
collected 5 items
tests/contextvar_test.py s [ 20%]
tests/nest_test.py FException: {'task': <Task pending coro=<NestTest.coro() running at /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/nest_test.py:23> wait_for=<Future pending cb=[Task.__wakeup()] created at /usr/lib/python3.7/asyncio/base_events.py:395> created at /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/nest_test.py:44>, 'message': 'Task was destroyed but it is pending!', 'source_traceback': [<FrameSummary file /usr/lib/python3.7/asyncio/base_events.py, line 574 in run_until_complete>, <FrameSummary file /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/nest_asyncio.py, line 71 in run_forever>, <FrameSummary file /usr/lib/python3.7/asyncio/base_events.py, line 1778 in _run_once>, <FrameSummary file /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/nest_asyncio.py, line 135 in run>, <FrameSummary file /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/nest_asyncio.py, line 101 in step>, <FrameSummary file /usr/lib/python3.7/asyncio/tasks.py, line 249 in __step>, <FrameSummary file /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/nest_test.py, line 44 in f>]}
FFF [100%]
=================================== FAILURES ===================================
_____________ NestTest.test_ensure_future_with_run_until_complete ______________
self = <tests.nest_test.NestTest testMethod=test_ensure_future_with_run_until_complete>
def test_ensure_future_with_run_until_complete(self):
async def f():
task = asyncio.ensure_future(self.coro())
return self.loop.run_until_complete(task)
> result = self.loop.run_until_complete(f())
tests/nest_test.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.7/asyncio/base_events.py:587: in run_until_complete
return future.result()
/usr/lib/python3.7/asyncio/futures.py:181: in result
raise self._exception
/usr/lib/python3.7/asyncio/tasks.py:249: in __step
result = coro.send(None)
tests/nest_test.py:45: in f
return self.loop.run_until_complete(task)
/usr/lib/python3.7/asyncio/base_events.py:563: in run_until_complete
self._check_runnung()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_UnixSelectorEventLoop running=False closed=True debug=True>
def _check_runnung(self):
if self.is_running():
> raise RuntimeError('This event loop is already running')
E RuntimeError: This event loop is already running
/usr/lib/python3.7/asyncio/base_events.py:523: RuntimeError
________ NestTest.test_ensure_future_with_run_until_complete_with_wait _________
self = <tests.nest_test.NestTest testMethod=test_ensure_future_with_run_until_complete_with_wait>
def test_ensure_future_with_run_until_complete_with_wait(self):
async def f():
task = asyncio.ensure_future(self.coro())
done, pending = self.loop.run_until_complete(
asyncio.wait([task], return_when=asyncio.ALL_COMPLETED))
task = done.pop()
return task.result()
> result = self.loop.run_until_complete(f())
tests/nest_test.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.7/asyncio/base_events.py:587: in run_until_complete
return future.result()
/usr/lib/python3.7/asyncio/futures.py:181: in result
raise self._exception
/usr/lib/python3.7/asyncio/tasks.py:249: in __step
result = coro.send(None)
tests/nest_test.py:55: in f
asyncio.wait([task], return_when=asyncio.ALL_COMPLETED))
/usr/lib/python3.7/asyncio/base_events.py:563: in run_until_complete
self._check_runnung()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_UnixSelectorEventLoop running=False closed=True debug=True>
def _check_runnung(self):
if self.is_running():
> raise RuntimeError('This event loop is already running')
E RuntimeError: This event loop is already running
/usr/lib/python3.7/asyncio/base_events.py:523: RuntimeError
____________________________ NestTest.test_nesting _____________________________
self = <tests.nest_test.NestTest testMethod=test_nesting>
def test_nesting(self):
async def f1():
result = self.loop.run_until_complete(self.coro())
self.assertEqual(result, await self.coro())
return result
async def f2():
result = self.loop.run_until_complete(f1())
self.assertEqual(result, await f1())
return result
> result = self.loop.run_until_complete(f2())
tests/nest_test.py:38:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.7/asyncio/base_events.py:587: in run_until_complete
return future.result()
/usr/lib/python3.7/asyncio/futures.py:181: in result
raise self._exception
/usr/lib/python3.7/asyncio/tasks.py:249: in __step
result = coro.send(None)
tests/nest_test.py:34: in f2
result = self.loop.run_until_complete(f1())
/usr/lib/python3.7/asyncio/base_events.py:563: in run_until_complete
self._check_runnung()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_UnixSelectorEventLoop running=False closed=True debug=True>
def _check_runnung(self):
if self.is_running():
> raise RuntimeError('This event loop is already running')
E RuntimeError: This event loop is already running
/usr/lib/python3.7/asyncio/base_events.py:523: RuntimeError
____________________________ NestTest.test_timeout _____________________________
self = <tests.nest_test.NestTest testMethod=test_timeout>
def test_timeout(self):
async def f1():
await asyncio.sleep(0.1)
async def f2():
asyncio.run(asyncio.wait_for(f1(), 0.01))
with self.assertRaises(asyncio.TimeoutError):
> self.loop.run_until_complete(f2())
tests/nest_test.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.7/asyncio/base_events.py:587: in run_until_complete
return future.result()
/usr/lib/python3.7/asyncio/futures.py:181: in result
raise self._exception
/usr/lib/python3.7/asyncio/tasks.py:249: in __step
result = coro.send(None)
tests/nest_test.py:68: in f2
asyncio.run(asyncio.wait_for(f1(), 0.01))
nest_asyncio.py:31: in run
return loop.run_until_complete(future)
/usr/lib/python3.7/asyncio/base_events.py:563: in run_until_complete
self._check_runnung()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def _check_runnung(self):
if self.is_running():
> raise RuntimeError('This event loop is already running')
E RuntimeError: This event loop is already running
/usr/lib/python3.7/asyncio/base_events.py:523: RuntimeError
=============================== warnings summary ===============================
/usr/lib/python3/dist-packages/_pytest/mark/structures.py:335
/usr/lib/python3/dist-packages/_pytest/mark/structures.py:335: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
PytestUnknownMarkWarning,
.pybuild/cpython3_3.7/build/tests/contextvar_test.py::TestContextVars::test_context_var
/usr/lib/python3/dist-packages/_pytest/python.py:170: PytestUnhandledCoroutineWarning: Coroutine functions are not natively supported and have been skipped.
You need to install a suitable plugin for your async framework, for example:
- pytest-asyncio
- pytest-trio
- pytest-tornasync
warnings.warn(PytestUnhandledCoroutineWarning(msg.format(pyfuncitem.nodeid)))
.pybuild/cpython3_3.7/build/tests/nest_test.py::NestTest::test_timeout
/usr/lib/python3.7/traceback.py:220: RuntimeWarning: coroutine 'wait_for' was never awaited
Coroutine created at (most recent call last)
File "/usr/lib/python3.7/unittest/case.py", line 676, in __call__
return self.run(*args, **kwds)
File "/usr/lib/python3.7/unittest/case.py", line 628, in run
testMethod()
File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/nest_test.py", line 71, in test_timeout
self.loop.run_until_complete(f2())
File "/usr/lib/python3.7/asyncio/base_events.py", line 574, in run_until_complete
self.run_forever()
File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/nest_asyncio.py", line 71, in run_forever
self._run_once()
File "/usr/lib/python3.7/asyncio/base_events.py", line 1778, in _run_once
handle._run()
File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/nest_asyncio.py", line 135, in run
ctx.run(self._callback, *self._args)
File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/nest_asyncio.py", line 101, in step
step_orig(task, exc)
File "/usr/lib/python3.7/asyncio/tasks.py", line 249, in __step
result = coro.send(None)
File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/nest_test.py", line 68, in f2
asyncio.run(asyncio.wait_for(f1(), 0.01))
tb.tb_frame.clear()
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=============== 4 failed, 1 skipped, 3 warnings in 0.77 seconds ================
sys:1: RuntimeWarning: coroutine 'wait' was never awaited
Coroutine created at (most recent call last)
File "/usr/lib/python3.7/unittest/case.py", line 676, in __call__
return self.run(*args, **kwds)
File "/usr/lib/python3.7/unittest/case.py", line 628, in run
testMethod()
File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/nest_test.py", line 59, in test_ensure_future_with_run_until_complete_with_wait
result = self.loop.run_until_complete(f())
File "/usr/lib/python3.7/asyncio/base_events.py", line 574, in run_until_complete
self.run_forever()
File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/nest_asyncio.py", line 71, in run_forever
self._run_once()
File "/usr/lib/python3.7/asyncio/base_events.py", line 1778, in _run_once
handle._run()
File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/nest_asyncio.py", line 135, in run
ctx.run(self._callback, *self._args)
File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/nest_asyncio.py", line 101, in step
step_orig(task, exc)
File "/usr/lib/python3.7/asyncio/tasks.py", line 249, in __step
result = coro.send(None)
File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/nest_test.py", line 55, in f
asyncio.wait([task], return_when=asyncio.ALL_COMPLETED))
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
sys:1: RuntimeWarning: coroutine 'NestTest.test_nesting.<locals>.f1' was never awaited
Coroutine created at (most recent call last)
File "/usr/lib/python3.7/unittest/case.py", line 676, in __call__
return self.run(*args, **kwds)
File "/usr/lib/python3.7/unittest/case.py", line 628, in run
testMethod()
File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/nest_test.py", line 38, in test_nesting
result = self.loop.run_until_complete(f2())
File "/usr/lib/python3.7/asyncio/base_events.py", line 574, in run_until_complete
self.run_forever()
File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/nest_asyncio.py", line 71, in run_forever
self._run_once()
File "/usr/lib/python3.7/asyncio/base_events.py", line 1778, in _run_once
handle._run()
File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/nest_asyncio.py", line 135, in run
ctx.run(self._callback, *self._args)
File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/nest_asyncio.py", line 101, in step
step_orig(task, exc)
File "/usr/lib/python3.7/asyncio/tasks.py", line 249, in __step
result = coro.send(None)
File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/nest_test.py", line 34, in f2
result = self.loop.run_until_complete(f1())
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Exception: {'task': <Task pending coro=<NestTest.coro() running at /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/nest_test.py:23> wait_for=<Future pending cb=[Task.__wakeup()] created at /usr/lib/python3.7/asyncio/base_events.py:395> created at /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/nest_test.py:53>, 'message': 'Task was destroyed but it is pending!', 'source_traceback': [<FrameSummary file /usr/lib/python3.7/asyncio/base_events.py, line 574 in run_until_complete>, <FrameSummary file /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/nest_asyncio.py, line 71 in run_forever>, <FrameSummary file /usr/lib/python3.7/asyncio/base_events.py, line 1778 in _run_once>, <FrameSummary file /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/nest_asyncio.py, line 135 in run>, <FrameSummary file /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/nest_asyncio.py, line 101 in step>, <FrameSummary file /usr/lib/python3.7/asyncio/tasks.py, line 249 in __step>, <FrameSummary file /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/nest_test.py, line 53 in f>]}
E: pybuild pybuild:352: test: plugin distutils failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build; python3.7 -m pytest tests
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.7 3.8" returned exit code 13
make: *** [debian/rules:6: binary-arch] Error 25
Version 1.3.2 seems to be fixed.
More information about the Python-modules-team
mailing list