Skip to content

test_example_accessions.py poisons model caches for tests that run after it #255

Description

@sorenwacker

Context: running the full suite with a marker set that includes network tests (e.g. the pre-260824 Makefile's -m "not ui"), tests/test_example_accessions.py causes three later failures in tests/test_examples.py: the ena 1.0 Study/Sample inline examples and the ena example file fail validation with "Extra inputs are not permitted" for nested list fields (experiments, analyses) — i.e. the validating model has lost its nested fields. On a clean checkout the same pairing also broke a miappe 1.2 DataFile example, so the victim depends on ordering, not on the ena profile.

Reproduce: uv run pytest -m "not ui" tests/test_example_accessions.py tests/test_examples.py — 3 failures; each file alone passes.

Goal: a test run's outcome must not depend on which tests ran before it. Find what test_example_accessions.py mutates in shared state (the SpecLoader profile cache or the model registry are the suspects, given the symptom is a core-fields-only model answering for a profile entity) and isolate it.

Scope: the Makefile marker drift that exposed this locally is already fixed (make test now matches CI's not selenium and not network, per the documented convention). This issue is only the isolation defect, which still bites anyone running network tests together with the rest of the suite.

Acceptance criteria: the reproduction pairing passes; a regression guard exists that fails if the poisoning returns; no test in the suite depends on marker-based deselection for correctness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions