Skip to content

test: make test_stream_run.py resolve its feature group standalone - #1088

Open
dchaudhari7177 wants to merge 1 commit into
mloda-ai:mainfrom
dchaudhari7177:fix/stream-run-standalone-fixture
Open

test: make test_stream_run.py resolve its feature group standalone#1088
dchaudhari7177 wants to merge 1 commit into
mloda-ai:mainfrom
dchaudhari7177:fix/stream-run-standalone-fixture

Conversation

@dchaudhari7177

Copy link
Copy Markdown
Contributor

Closes #1084.

The dependency

test_stream_run.py requests the feature EngineRunnerTest1. Its FeatureGroup is defined in tests/test_core/test_integration/test_core/test_runner_one_compute_framework.py. Resolution walks live FeatureGroup subclasses, so that module has to be imported before stream_run plans.

Nothing in test_stream_run.py imported it. The tests passed only because tests/test_core/test_runtime/conftest.py imports that module for test_stream_all.py, and a full run collects the sibling package first.

Reproduction, on a clean tree

pytest tests/test_core/test_api/test_stream_run.py -q
FAILED TestStreamRunReturnsGenerator::test_stream_run_returns_generator_type
FAILED TestStreamRunReturnsGenerator::test_stream_run_is_not_a_list
mloda.core.prepare.identify_feature_group.FeatureResolutionError:
No feature groups found for feature name: 'EngineRunnerTest1'.

2 failed, 1 passed. A full tox run is green, which is what kept this invisible at the gate.

The change

Import the defining module from the test module itself — the same one-line registration tests/test_core/test_runtime/conftest.py already relies on, with the same reasoning in a comment.

tests/test_core/test_runtime/conftest.py is left in place: test_stream_all.py still needs it, and it is that package's own registration.

Verification

command before after
pytest tests/test_core/test_api/test_stream_run.py 2 failed, 1 passed 3 passed
pytest .../test_stream_run.py .../test_runtime/test_stream_all.py 8 passed 8 passed

Gates on the changed file: ruff format --check --line-length 120, ruff check, mypy --strict --ignore-missing-imports all clean.

One unrelated line in the same file

The module docstring still claimed:

All tests are expected to FAIL because:

  • mlodaAPI does not have a stream_run method yet

stream_run exists and the file has been green in full runs for a while, so that paragraph is dropped. Happy to pull it back out if you would rather keep this diff to the import alone.

test_stream_run.py requests the feature EngineRunnerTest1, whose FeatureGroup is
defined in tests/test_core/test_integration/test_core/test_runner_one_compute_framework.
Resolution walks live FeatureGroup subclasses, so the module has to be imported
before stream_run plans. Nothing in test_stream_run.py imported it: the tests only
passed because tests/test_core/test_runtime/conftest.py imports it for
test_stream_all.py, and a full run collects that package first.

Running the file on its own failed two of three tests with
FeatureResolutionError: No feature groups found for feature name: 'EngineRunnerTest1'.

Import the defining module from the test module itself, the same one-line
registration test_stream_all.py already relies on.

Also drop the module docstring's claim that all tests are expected to fail
because mlodaAPI has no stream_run method; the method exists and the file has
been green in full runs for a while.

Closes mloda-ai#1084
@dchaudhari7177
dchaudhari7177 force-pushed the fix/stream-run-standalone-fixture branch from f304cbf to b5ea1a1 Compare August 7, 2026 03:50
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.

test_stream_run.py depends on a fixture defined in another test package

1 participant