Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.4.0: pytest fails because missing test.support #6

Open
kloczek opened this issue Mar 21, 2024 · 5 comments
Open

5.4.0: pytest fails because missing test.support #6

kloczek opened this issue Mar 21, 2024 · 5 comments

Comments

@kloczek
Copy link

kloczek commented Mar 21, 2024

I'm not sure but on first look looks lik eon file is missing in tests/

+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.9.18, pytest-8.1.1, pluggy-1.4.0
rootdir: /home/tkloczko/rpmbuild/BUILD/jaraco.test-5.4.0
configfile: pytest.ini
plugins: jaraco.test-5.4.0
collected 5 items / 1 deselected / 4 selected

jaraco/test/__init__.py .                                                [ 25%]
jaraco/test/cpython.py FF                                                [ 75%]
tests/test_http.py .                                                     [100%]

=================================== 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.9/doctest.py", line 1334, in __run
    exec(compile(example.source, filename, "single",
  File "<doctest test.cpython[0]>", line 1, in <module>
  File "/home/tkloczko/rpmbuild/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'
/home/tkloczko/rpmbuild/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.9/doctest.py", line 1334, in __run
    exec(compile(example.source, filename, "single",
  File "<doctest test.cpython.from_test_support[0]>", line 1, in <module>
  File "/home/tkloczko/rpmbuild/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'
/home/tkloczko/rpmbuild/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, 2 passed, 1 deselected in 0.14s ===================
@kloczek
Copy link
Author

kloczek commented Mar 21, 2024

And other small issue is as well here that new/temporary directory added begore start build are breaking build (missing some bits in pyproject.toml)

+ /usr/bin/python3 -sBm build -w --no-isolation
* Getting build dependencies for wheel...
error: Multiple top-level packages discovered in a flat-layout: ['jaraco', 'SPECPARTS'].

To avoid accidental inclusion of unwanted files or directories,
setuptools will not proceed with this build.

If you are trying to create a single distribution with multiple packages
on purpose, you should not rely on automatic discovery.
Instead, consider the following options:

1. set up custom discovery (`find` directive with `include` or `exclude`)
2. use a `src-layout`
3. explicitly set `py_modules` or `packages` with a list of names

To find more information, look for "package discovery" on setuptools docs.

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel

@kloczek
Copy link
Author

kloczek commented Apr 9, 2024

Gentle ping .. any update?
Could you please at least confirm that test suite is not in useable state? 🤔

@mweinelt
Copy link

We experience the same issue on nixpkgs, and importlib-resources 6.4.0 now relies on jaraco.test.cython, exhibiting the same problem.

@stanislavlevin
Copy link

@s-t-e-v-e-n-k
Copy link

Ah ha, but test.support is provided by Python itself, and isn't missing, but pytest insists it isn't there:

> python3.10
Python 3.10.14 (main, Mar 21 2024, 16:45:28) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import test.support
>>> test.support.__file__
'/usr/lib64/python3.10/test/support/__init__.py'

And under pytest:

[   10s] Traceback (most recent call last):
[   10s]   File "/usr/lib64/python3.10/doctest.py", line 1350, in __run
[   10s]     exec(compile(example.source, filename, "single",
[   10s]   File "<doctest test.cpython[0]>", line 1, in <module>
[   10s]   File "/home/abuild/rpmbuild/BUILD/jaraco.test-5.4.0/jaraco/test/cpython.py", line 25, in from_test_support
[   10s]     import test.support
[   10s] ModuleNotFoundError: No module named 'test.support'

I've bisected this down to being introduced by pytest commit c85fce39b60a6cc3537e9da3e7a4f4946cfe4d49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants