Bug 1914847
Summary: | python-pytest4 fails to build with Python 3.10: ImportWarning: AssertionRewritingHook.exec_module() not found; falling back to load_module() | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Tomáš Hrnčiar <thrnciar> |
Component: | python-pytest4 | Assignee: | Orphan Owner <extras-orphan> |
Status: | CLOSED WONTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | dradez, mhroncok, mrunge, python-sig, thomas.moschny, thrnciar |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-04-13 14:49:31 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1890881 |
Description
Tomáš Hrnčiar
2021-01-11 10:36:17 UTC
This is hard to backport: https://github.com/pytest-dev/pytest/commit/4cd08f9b52e3ed984cf68b58abb6f7350623231f I guess I'll just try to ignore the warning instead. I've created https://github.com/pytest-dev/pytest/pull/8236 but there are still some failures: =================================== FAILURES =================================== _____________ TestAssertionRewriteHookDetails.test_reload_reloads ______________ self = <test_assertrewrite.TestAssertionRewriteHookDetails object at 0x7f9bc9d46e20> testdir = <Testdir local('/tmp/pytest-of-mockbuild/pytest-3/test_reload_reloads0')> def test_reload_reloads(self, testdir): """Reloading a module after change picks up the change.""" testdir.tmpdir.join("file.py").write( textwrap.dedent( """ def reloaded(): return False def rewrite_self(): with open(__file__, 'w') as self: self.write('def reloaded(): return True') """ ) ) testdir.tmpdir.join("pytest.ini").write( textwrap.dedent( """ [pytest] python_files = *.py """ ) ) testdir.makepyfile( test_fun=""" import sys try: from imp import reload except ImportError: pass def test_loader(): import file assert not file.reloaded() file.rewrite_self() reload(file) assert file.reloaded() """ ) result = testdir.runpytest("-s") > result.stdout.fnmatch_lines(["* 1 passed*"]) E Failed: nomatch: '* 1 passed*' E and: '============================= test session starts ==============================' E and: 'platform linux -- Python 3.10.0a4, pytest-4.6.11, py-1.10.0, pluggy-0.13.1' E and: 'rootdir: /tmp/pytest-of-mockbuild/pytest-3/test_reload_reloads0, inifile: pytest.ini' E and: 'plugins: hypothesis-5.41.3' E and: 'collected 1 item' E and: '' E and: 'test_fun.py F' E and: '' E and: '=================================== FAILURES ===================================' E and: '_________________________________ test_loader __________________________________' E and: '' E and: ' def test_loader():' E and: ' import file' E and: ' assert not file.reloaded()' E and: ' file.rewrite_self()' E and: ' reload(file)' E and: '> assert file.reloaded()' E and: 'E AssertionError: assert False' E and: 'E + where False = <function reloaded at 0x7f9bc9d65790>()' E and: "E + where <function reloaded at 0x7f9bc9d65790> = <module 'file' (<_pytest.assertion.rewrite.AssertionRewritingHook object at 0x7f9bc817eeb0>)>.reloaded" E and: '' E and: 'test_fun.py:12: AssertionError' E and: '=========================== 1 failed in 0.01 seconds ===========================' E and: '' E remains unmatched: '* 1 passed*' /builddir/build/BUILD/pytest-4.6.11/testing/test_assertrewrite.py:1142: Failed ----------------------------- Captured stdout call ----------------------------- ============================= test session starts ============================== platform linux -- Python 3.10.0a4, pytest-4.6.11, py-1.10.0, pluggy-0.13.1 rootdir: /tmp/pytest-of-mockbuild/pytest-3/test_reload_reloads0, inifile: pytest.ini plugins: hypothesis-5.41.3 collected 1 item test_fun.py F =================================== FAILURES =================================== _________________________________ test_loader __________________________________ def test_loader(): import file assert not file.reloaded() file.rewrite_self() reload(file) > assert file.reloaded() E AssertionError: assert False E + where False = <function reloaded at 0x7f9bc9d65790>() E + where <function reloaded at 0x7f9bc9d65790> = <module 'file' (<_pytest.assertion.rewrite.AssertionRewritingHook object at 0x7f9bc817eeb0>)>.reloaded test_fun.py:12: AssertionError =========================== 1 failed in 0.01 seconds =========================== This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle. Changing version to 34. At this point, I think we should just skip the failing tests and/or orphan the package. See also https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/6IVE4XM5UPZOXNRSRIWQL5PF4RA4QEOS/ Automation has figured out the package is retired in rawhide. If you like it to be unretired, please open a ticket at https://pagure.io/releng/new_issue?template=package_unretirement |