Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1739895 - python-asynctest fails to build with Python 3.8
Summary: python-asynctest fails to build with Python 3.8
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-asynctest
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Dominik 'Rathann' Mierzejewski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F32FTBFS F32FailsToInstall PYTHON38 1773371
TreeView+ depends on / blocked
 
Reported: 2019-08-11 20:12 UTC by Miro Hrončok
Modified: 2019-12-03 10:34 UTC (History)
3 users (show)

Fixed In Version: python-asynctest-0.13.0-3.fc32
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-12-03 10:34:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github Martiusweb asynctest issues 126 0 'None' open DeprecationWarning in 3.8 2020-05-12 09:55:09 UTC
Github Martiusweb asynctest issues 132 0 'None' open Test case failures in Python 3.8 2020-05-12 09:55:09 UTC
Github Martiusweb asynctest issues 144 0 'None' open Integrating with Python 3.8 2020-05-12 09:55:09 UTC

Description Miro Hrončok 2019-08-11 20:12:07 UTC
python-asynctest fails to build with Python 3.8.0b3.

+ python3 -m unittest test
/builddir/build/BUILD/asynctest-0.13.0/test/test_helpers.py:12: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
  return (yield from asyncio.wait_for(coro, loop=self.loop, timeout=1))
................/builddir/build/BUILD/asynctest-0.13.0/asynctest/mock.py:599: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def proxy():
./builddir/build/BUILD/asynctest-0.13.0/asynctest/mock.py:594: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  result = asyncio.coroutine(_raise)(e)
....../builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:176: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  mock.side_effect = asyncio.coroutine(lambda: 'ProbeValue')
../builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:163: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  coroutine = asyncio.coroutine(lambda: 'ProbeValue')
........../builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:550: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def side_effect():
./builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:531: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def side_effect():
..F../builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:776: RuntimeWarning: coroutine 'AsyncMockMixin._mock_call' was never awaited
  yield from mock("arg0", "arg1", "arg2")
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
E......../builddir/build/BUILD/asynctest-0.13.0/asynctest/mock.py:599: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def proxy():
............................./builddir/build/BUILD/asynctest-0.13.0/asynctest/mock.py:599: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def proxy():
.........../builddir/build/BUILD/asynctest-0.13.0/test/test_case.py:320: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def cleanup_coro():
./builddir/build/BUILD/asynctest-0.13.0/test/test_case.py:236: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def set_ran(self):
./builddir/build/BUILD/asynctest-0.13.0/test/test_case.py:213: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def runTest(self):
....../builddir/build/BUILD/asynctest-0.13.0/test/test_case.py:283: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def setUp(self):
.../builddir/build/BUILD/asynctest-0.13.0/test/test_case.py:50: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
  out, err = yield from asyncio.wait_for(
.................../builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:2175: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  a_coroutine, side_effect=asyncio.coroutine(lambda r: r))
/builddir/build/BUILD/asynctest-0.13.0/asynctest/mock.py:599: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def proxy():
./builddir/build/BUILD/asynctest-0.13.0/asynctest/mock.py:594: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  result = asyncio.coroutine(_raise)(e)
.........................../builddir/build/BUILD/asynctest-0.13.0/test/test_case.py:848: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  self.addCleanup(asyncio.coroutine(lambda: None))
../builddir/build/BUILD/asynctest-0.13.0/test/test_case.py:800: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def runTest(self):
................/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:971: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def a_coroutine():
/builddir/build/BUILD/asynctest-0.13.0/asynctest/mock.py:1001: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  patched = asyncio.coroutine(patched)
../builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1574: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def a_coroutine():
/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1583: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def a_coroutine():
......./builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1043: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def tester(coroutine_function):
..../builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1677: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def tester(coro_function):
./builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1334: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def a_coroutine(missing_arg):
/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1339: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def tester():
/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1356: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def tester():
../builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1870: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def tester(coro_function):
../builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1788: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def tester(coro_function):
......./builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1976: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def tester(coro_function):
/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1928: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def tester(coro_function):
./builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1961: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def a_coroutine(mock):
./builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1189: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def test_a_coroutine(self):
./builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1161: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def a_coroutine():
.../builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1490: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def tester_coroutine(future):
/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1514: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def a_coroutine(future):
/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1526: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def a_coroutine(future):
...../builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1140: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def a_coroutine():
.../builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py:1102: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
  def a_coroutine():
............
======================================================================
ERROR: test_create_autospec_on_coroutine_and_using_assert_methods (test.test_mock.Test_CoroutineMock_awaited)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/asynctest-0.13.0/asynctest/case.py", line 297, in run
    self._run_test_method(testMethod)
  File "/builddir/build/BUILD/asynctest-0.13.0/asynctest/case.py", line 354, in _run_test_method
    self.loop.run_until_complete(result)
  File "/builddir/build/BUILD/asynctest-0.13.0/asynctest/case.py", line 224, in wrapper
    return method(*args, **kwargs)
  File "/usr/lib64/python3.8/asyncio/base_events.py", line 608, in run_until_complete
    return future.result()
  File "/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py", line 776, in test_create_autospec_on_coroutine_and_using_assert_methods
    yield from mock("arg0", "arg1", "arg2")
TypeError: cannot 'yield from' a coroutine object in a non-coroutine generator

======================================================================
FAIL: test_awaited_from_autospec_mock (test.test_mock.Test_CoroutineMock_awaited)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/asynctest-0.13.0/asynctest/case.py", line 297, in run
    self._run_test_method(testMethod)
  File "/builddir/build/BUILD/asynctest-0.13.0/asynctest/case.py", line 354, in _run_test_method
    self.loop.run_until_complete(result)
  File "/builddir/build/BUILD/asynctest-0.13.0/asynctest/case.py", line 224, in wrapper
    return method(*args, **kwargs)
  File "/usr/lib64/python3.8/asyncio/base_events.py", line 608, in run_until_complete
    return future.result()
  File "/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py", line 571, in test_awaited_from_autospec_mock
    self.assertFalse(mock.a_coroutine.awaited)
AssertionError: <unittest.mock._AwaitEvent object at 0x7fe608fda4f0> is not false

======================================================================
FAIL: test_patch_coroutine_with_multiple_scopes (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope) [new style coroutine - Outer: GLOBAL, inner: LIMITED]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py", line 1719, in test_patch_coroutine_with_multiple_scopes
    run_coroutine(tester(a_native_coroutine))
  File "/builddir/build/BUILD/asynctest-0.13.0/test/utils.py", line 9, in run_coroutine
    return loop.run_until_complete(coroutine)
  File "/usr/lib64/python3.8/asyncio/base_events.py", line 608, in run_until_complete
    return future.result()
  File "/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py", line 1683, in tester
    self.assertEqual((True, False), fut.result())
AssertionError: Tuples differ: (True, False) != (True, True)

First differing element 1:
False
True

- (True, False)
+ (True, True)

======================================================================
FAIL: test_patch_coroutine_with_multiple_scopes (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope) [new style coroutine - Outer: LIMITED, inner: GLOBAL]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py", line 1730, in test_patch_coroutine_with_multiple_scopes
    run_coroutine(tester(a_native_coroutine))
  File "/builddir/build/BUILD/asynctest-0.13.0/test/utils.py", line 9, in run_coroutine
    return loop.run_until_complete(coroutine)
  File "/usr/lib64/python3.8/asyncio/base_events.py", line 608, in run_until_complete
    return future.result()
  File "/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py", line 1683, in tester
    self.assertEqual((True, False), fut.result())
AssertionError: Tuples differ: (True, False) != (True, True)

First differing element 1:
False
True

- (True, False)
+ (True, True)

======================================================================
FAIL: test_multiple_patches_on_coroutine (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope_LIMITED) [new style coroutine]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py", line 2007, in test_multiple_patches_on_coroutine
    run_coroutine(tester(a_native_coroutine))
  File "/builddir/build/BUILD/asynctest-0.13.0/test/utils.py", line 9, in run_coroutine
    return loop.run_until_complete(coroutine)
  File "/usr/lib64/python3.8/asyncio/base_events.py", line 608, in run_until_complete
    return future.result()
  File "/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py", line 1982, in tester
    self.assertEqual((False, False), fut.result())
AssertionError: Tuples differ: (False, False) != (True, True)

First differing element 0:
False
True

- (False, False)
+ (True, True)

======================================================================
FAIL: test_patch_coroutine_only_when_running (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope_LIMITED) [new style coroutine]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py", line 1955, in test_patch_coroutine_only_when_running
    run_coroutine(tester(a_native_coroutine))
  File "/builddir/build/BUILD/asynctest-0.13.0/test/utils.py", line 9, in run_coroutine
    return loop.run_until_complete(coroutine)
  File "/usr/lib64/python3.8/asyncio/base_events.py", line 608, in run_until_complete
    return future.result()
  File "/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py", line 1934, in tester
    self.assertFalse(fut.result())
AssertionError: True is not false

----------------------------------------------------------------------
Ran 220 tests in 0.611s

FAILED (failures=5, errors=1)

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.8/fedora-rawhide-x86_64/00997510-python-asynctest/

For all our attempts to build python-asynctest with Python 3.8, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.8/package/python-asynctest/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.8:
https://copr.fedorainfracloud.org/coprs/g/python/python3.8/

Let us know here if you have any questions.

Comment 1 Karthikeyan Singaravelan 2019-08-12 04:41:29 UTC
Upstream report : https://github.com/Martiusweb/asynctest/issues/132 . Seems someone is working on a patch as I can see from GitHub UI referencing the issue in commits.

Comment 2 Dominik 'Rathann' Mierzejewski 2019-08-13 14:47:03 UTC
Thanks, I found that one, too. However, I'm getting this traceback with the two patches (50225b83c0c5803b06584b173a5df837361cad3b and b6eb76626dd3eb94b43e582fdf66c3d25560f8e6) applied:
+ python3 -m unittest test
Traceback (most recent call last):
  File "/usr/lib64/python3.8/runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib64/python3.8/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib64/python3.8/unittest/__main__.py", line 18, in <module>
    main(module=None)
  File "/usr/lib64/python3.8/unittest/main.py", line 100, in __init__
    self.parseArgs(argv)
  File "/usr/lib64/python3.8/unittest/main.py", line 147, in parseArgs
    self.createTests()
  File "/usr/lib64/python3.8/unittest/main.py", line 158, in createTests
    self.test = self.testLoader.loadTestsFromNames(self.testNames,
  File "/usr/lib64/python3.8/unittest/loader.py", line 220, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib64/python3.8/unittest/loader.py", line 220, in <listcomp>
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib64/python3.8/unittest/loader.py", line 154, in loadTestsFromName
    module = __import__(module_name)
  File "/builddir/build/BUILD/asynctest-0.13.0/test/__init__.py", line 3, in <module>
    from .test_mock import *
  File "/builddir/build/BUILD/asynctest-0.13.0/test/test_mock.py", line 499, in <module>
    class Test_CoroutineMock(unittest.TestCase, _Test_called_coroutine,
TypeError: Cannot create a consistent method resolution
order (MRO) for bases TestCase, _Test_called_coroutine, _Test_Spec_Spec_Set_Returns_Coroutine_Mock
error: Bad exit status from /var/tmp/rpm-tmp.XUAggv (%check)
    Bad exit status from /var/tmp/rpm-tmp.XUAggv (%check)

Comment 3 Ben Cotton 2019-08-13 16:53:43 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 4 Ben Cotton 2019-08-13 17:03:16 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 5 Miro Hrončok 2019-08-13 17:17:11 UTC
Python 3.8 will happen in Fedora 32, changing back to rawhide.

Comment 6 Miro Hrončok 2019-08-14 22:24:31 UTC
The coordinated rebuild of Python 3.8 has started in the `f32-python` side tag.

If you figure out how to rebuild this package, please don't rebuild it in regular rawhide, but use the side tag instead:

    on branch master:
    $ fedpkg build --target=f32-python

To wait for a build to show up in the side tag, do:

    $ koji wait-repo f32-python --build=<nvr>

Where <nvr> is name-version-release of the source package, e.g. python-foo-1.1-2.fc32.

An updated mock config is posted at:
http://copr.fedorainfracloud.org/coprs/g/python/python3.8/

Note that it will take a while before the essential packages are rebuilt, so don't expect all your dependencies to be available right away.

Thanks. Let us know if you need up to date info, or if you have any questions.



PS this message is mass posted to all the bugs that block the PYTHON38 bug. If this is also a Fedora 31 FTBFS bug and you manage to fix it, you can do a f31 build as usual:

    on branch f31:
    $ fedpkg build

Comment 7 Miro Hrončok 2019-08-21 16:35:16 UTC
The f32-python side tag has been merged. In order to rebuild the package, do it in regular rawhide, but please wait until python3-3.8 is tagged:

  $ koji wait-repo f32-build --build python3-3.8.0~b3-3.fc32


If your built already started in f32-python, after it is finished, please tag it to rawhide with:

  $ koji tag-build f32-pending <nvr>

For example:

  $ koji tag-build f32-pending libreoffice-6.3.0.4-3.fc32

Thanks!

(This comment is mass posted to all bugzillas blocking the PYTHON38 tracking bug.)

Comment 8 Miro Hrončok 2019-08-21 17:29:19 UTC
(Python 3.8 has landed in the rawhide buildroot.)

Comment 9 Miro Hrončok 2019-11-17 23:51:10 UTC
Dominik, any news on a resolution or a workaround?

Do we keep the package or not? it fails to install.

Comment 10 Dominik 'Rathann' Mierzejewski 2019-11-18 11:08:21 UTC
Let's keep it for now. I'll ping upstream (unless you happen to have a patch for the failure).

Comment 11 Dominik 'Rathann' Mierzejewski 2019-12-03 08:46:23 UTC
There is a number of issues with asynctest under python 3.8, the largest of which is the fact that a subset of asynctest was merged[1] into the standard library. This is way beyond my python knowledge, so I'm going to defer to upstream on this unless someone else has a better idea.

[1] https://github.com/python/cpython/pull/9296

Comment 12 Dominik 'Rathann' Mierzejewski 2019-12-03 10:34:32 UTC
OK, I made it build by skipping the failing tests, but the code is basically broken under python 3.8 according to upstream: https://github.com/Martiusweb/asynctest/pull/134#issuecomment-511527234 .


Note You need to log in before you can comment on or make changes to this bug.