Skip to content

fix: repair the test suite on main - #2289

Open
abendrothj wants to merge 1 commit into
exo-explore:mainfrom
abendrothj:fix/pytest-collection-on-main
Open

fix: repair the test suite on main#2289
abendrothj wants to merge 1 commit into
exo-explore:mainfrom
abendrothj:fix/pytest-collection-on-main

Conversation

@abendrothj

Copy link
Copy Markdown

Problem

uv run pytest — the command in CLAUDE.md's pre-commit checklist — does not currently run on main. It aborts during collection:

ERROR src/exo/download/tests/test_cancel_download.py
... 8 errors during collection ...
190 deselected, 8 errors in 2.60s

Two independent causes:

1. src/exo/download/ has no __init__.py. Every other test package in the tree has one. Without it, pytest walks up only as far as src/exo/download/ when deriving a module name, so the eight files under src/exo/download/tests/ are imported as tests.test_*. With pythonpath = ".", the repo's top-level tests/ package wins that name and the imports fail:

ModuleNotFoundError: No module named 'tests.test_safetensors_index'

The failure only appears in a full-suite run — pytest src/exo/download/tests alone passes, which is likely why it went unnoticed.

2. rust/exo_rs/tests/test_python.py calls NetworkingHandle.new() with three arguments. The zenoh migration (#2132) added a namespace parameter:

pub fn new(
    identity: &str,
    namespace: &str,
    listen_port: u16,
    discovery_service_port: u16,
) -> PyResult<PyNetworkingHandle> {

so the test raises TypeError: NetworkingHandle.new() missing 1 required positional argument: 'discovery_service_port'.

Fix

Add the missing __init__.py, and pass a namespace in the test.

Result

before after
uv run pytest 8 collection errors, aborts 471 passed, 3 skipped

The 68 tests under src/exo/download/tests/ had not been running as part of a full-suite invocation.

Two unrelated breakages stop `uv run pytest` before it runs anything:

- src/exo/download/ has no __init__.py, so pytest derives the module name
  'tests.test_*' for everything under it and the top-level tests/ package
  shadows it. Eight files fail to import and collection aborts.
- test_python.py still calls NetworkingHandle.new() with three arguments;
  the zenoh migration (exo-explore#2132) added the namespace parameter.

Full suite goes from 8 collection errors to 471 passing.
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

Successfully merging this pull request may close these issues.

1 participant