Skip to content

Running tests fails #7

@robsdedude

Description

@robsdedude

What I did:

uv sync --group test
uv run pytest

What I got

[...]
__________________________________________________________________________________________ ERROR collecting tests/test_zlibdecompressor.py ___________________________________________________________________________________________
ImportError while importing test module '[...]/zlib-py/tests/test_zlibdecompressor.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../.pyenv/versions/3.14.4/lib/python3.14/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/test_zlibdecompressor.py:20: in <module>
    from tests.test_compressobj import HAMLET_SCENE  # vendored block, reused
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E   ModuleNotFoundError: No module named 'tests'

Workaround for me: make tests a package: touch tests/__init__.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions