Skip to content

Tests in source distribution fail due to missing conftest module #117

Description

@mgorny
=============================================================== ERRORS ================================================================
_____________________________________________ ERROR collecting tests/test_ruff_format.py ______________________________________________
ImportError while importing test module '/tmp/portage/dev-python/python-lsp-ruff-2.3.2/work/python_lsp_ruff-2.3.2/tests/test_ruff_format.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.12/site-packages/_pytest/python.py:508: in importtestmodule
    mod = import_path(
/usr/lib/python3.12/site-packages/_pytest/pathlib.py:596: in import_path
    importlib.import_module(module_name)
/usr/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
/usr/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:188: in exec_module
    exec(co, module.__dict__)
tests/test_ruff_format.py:7: in <module>
    from conftest import temp_document
E   ModuleNotFoundError: No module named 'conftest'
______________________________________________ ERROR collecting tests/test_ruff_lint.py _______________________________________________
ImportError while importing test module '/tmp/portage/dev-python/python-lsp-ruff-2.3.2/work/python_lsp_ruff-2.3.2/tests/test_ruff_lint.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.12/site-packages/_pytest/python.py:508: in importtestmodule
    mod = import_path(
/usr/lib/python3.12/site-packages/_pytest/pathlib.py:596: in import_path
    importlib.import_module(module_name)
/usr/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
/usr/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:188: in exec_module
    exec(co, module.__dict__)
tests/test_ruff_lint.py:12: in <module>
    from conftest import temp_document
E   ModuleNotFoundError: No module named 'conftest'
--------------- generated xml file: /tmp/portage/dev-python/python-lsp-ruff-2.3.2/temp/pytest-xml/python3.12-GjMYzh.xml ---------------
======================================================= short test summary info =======================================================
ERROR tests/test_ruff_format.py
ERROR tests/test_ruff_lint.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================== 2 errors in 0.64s ==========================================================```

And apparently there are significant differences between the source distribution and v2.3.2 git tag (and main, so to say).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions