Bug 2279864 - python-jaraco-test fails to build with pytest 8: ModuleNotFoundError: No module named 'test.support'
Summary: python-jaraco-test fails to build with pytest 8: ModuleNotFoundError: No modu...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-jaraco-test
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lumír Balhar
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 2256331
TreeView+ depends on / blocked
 
Reported: 2024-05-09 10:56 UTC by Tomáš Hrnčiar
Modified: 2024-08-12 16:00 UTC (History)
5 users (show)

Fixed In Version: python-jaraco-test-5.4.0-4.fc41
Clone Of:
Environment:
Last Closed: 2024-08-12 16:00:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github jaraco jaraco.test issues 6 0 None open 5.4.0: pytest fails because missing `test.support` 2024-05-14 13:57:58 UTC

Description Tomáš Hrnčiar 2024-05-09 10:56:27 UTC
python-jaraco-test fails to build with pytest 8.

=================================== FAILURES ===================================
____________________________ [doctest] test.cpython ____________________________
001 
002 Compatibility shims for getting stuff from test.support across
003 Python versions (for compatibility with Python 3.9 and earlier).
004 
005 >>> os_helper = try_import('os_helper') or from_test_support('temp_dir')
UNEXPECTED EXCEPTION: ModuleNotFoundError("No module named 'test.support'")
Traceback (most recent call last):
  File "/usr/lib64/python3.12/doctest.py", line 1361, in __run
    exec(compile(example.source, filename, "single",
  File "<doctest test.cpython[0]>", line 1, in <module>
  File "/builddir/build/BUILD/jaraco.test-5.4.0/jaraco/test/cpython.py", line 25, in from_test_support
    import test.support
ModuleNotFoundError: No module named 'test.support'
/builddir/build/BUILD/jaraco.test-5.4.0/jaraco/test/cpython.py:5: UnexpectedException
___________________ [doctest] test.cpython.from_test_support ___________________
018 
019     Return a SimpleNamespace of names from test.support.
020 
021     >>> support = from_test_support('swap_item')
UNEXPECTED EXCEPTION: ModuleNotFoundError("No module named 'test.support'")
Traceback (most recent call last):
  File "/usr/lib64/python3.12/doctest.py", line 1361, in __run
    exec(compile(example.source, filename, "single",
  File "<doctest test.cpython.from_test_support[0]>", line 1, in <module>
  File "/builddir/build/BUILD/jaraco.test-5.4.0/jaraco/test/cpython.py", line 25, in from_test_support
    import test.support
ModuleNotFoundError: No module named 'test.support'
/builddir/build/BUILD/jaraco.test-5.4.0/jaraco/test/cpython.py:21: UnexpectedException
=========================== short test summary info ============================
FAILED jaraco/test/cpython.py::test.cpython
FAILED jaraco/test/cpython.py::test.cpython.from_test_support
==================== 2 failed, 1 passed, 2 skipped in 0.04s ====================

https://docs.pytest.org/en/stable/changelog.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/thrnciar/pytest/fedora-rawhide-x86_64/07389052-python-jaraco-test/

For all our attempts to build python-jaraco-test with pytest 8, see:
https://copr.fedorainfracloud.org/coprs/thrnciar/pytest/package/python-jaraco-test/

Let us know here if you have any questions.

Pytest 8 is planned to be included in Fedora 41. And this bugzilla is a
heads up before we merge new pytest into rawhide. For more info see a Fedora Change
proposal https://fedoraproject.org/wiki/Changes/Pytest_8

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Tomas Orsava 2024-05-22 12:22:43 UTC
Upstream: https://github.com/jaraco/jaraco.test/issues/6

Comment 2 Lumír Balhar 2024-05-27 19:16:47 UTC
This seems to be a bug in pytest itself and it's reported as such in: https://github.com/pytest-dev/pytest/issues/12303

Comment 3 Cristian Le 2024-08-09 12:11:20 UTC
I just hit this while working on the epel9 branch [1] with pytest 6.2.2 :/

[1]: https://download.copr.fedorainfracloud.org/results/packit/LecrisUT-importlib-resources-rpmspec-epel9/epel-9-x86_64/07895716-python-jaraco-test/builder-live.log.gz

Comment 4 Lumír Balhar 2024-08-12 08:53:19 UTC
(In reply to Cristian Le from comment #3)
> I just hit this while working on the epel9 branch [1] with pytest 6.2.2 :/
> 
> [1]:
> https://download.copr.fedorainfracloud.org/results/packit/LecrisUT-importlib-
> resources-rpmspec-epel9/epel-9-x86_64/07895716-python-jaraco-test/builder-
> live.log.gz

This is strange. The bug should be in pytest 8, not 6.

It seems that there is a workaround for the original problem: https://github.com/jaraco/jaraco.test/commit/40a16ec237c304075ec78c7a91978f26429917c2 (not yet released)

Comment 5 Fedora Update System 2024-08-12 10:28:32 UTC
FEDORA-2024-64de077e9c (python-jaraco-test-5.4.0-4.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-64de077e9c

Comment 6 Fedora Update System 2024-08-12 16:00:17 UTC
FEDORA-2024-64de077e9c (python-jaraco-test-5.4.0-4.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.


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