Skip to content

Share the linear-chain INIT model fixture via tests/conftest.py#27

Merged
edkerk merged 1 commit into
developfrom
test/conftest-linear-chain
Jun 10, 2026
Merged

Share the linear-chain INIT model fixture via tests/conftest.py#27
edkerk merged 1 commit into
developfrom
test/conftest-linear-chain

Conversation

@edkerk

@edkerk edkerk commented Jun 10, 2026

Copy link
Copy Markdown
Member

Tier-2 cleanup: dedupe the duplicated INIT model fixture into a shared
tests/conftest.py.

test_init.py, test_init_build.py and test_init_solvers.py each built the same
linear-chain INIT model (EX_A -> A -> B -> C -> D, reactions EX_A/r1/r2/r3)
independently — three copies differing only in the model id and whether gene rules
g1/g2/g3 were attached.

This extracts that construction into one place:

  • tests/conftest.py (new) provides linear_chain_model and
    linear_chain_model_with_genes fixtures (one private builder behind both).
  • test_init.py / test_init_build.py keep their model fixture name (so the test
    bodies are untouched) but now just return the shared fixture.
  • test_init_solvers.py drops its _toy_init_model() helper; the one test that used it
    injects linear_chain_model. Its bespoke _toy_ftinit_model is unchanged.

A fixture-duplication pass over the rest of the suite found no other genuine duplicates —
the remaining model builders are each shaped for their own test (biomass config, specific
yeast ids, multi-compartment transport, id-sorting, GPR-only, …) and stay local.

Verification

pytest (full suite) and ruff check green; no behaviour change (same models, same
assertions).

test_init.py, test_init_build.py and test_init_solvers.py each built the same
linear-chain INIT model (EX_A -> A -> B -> C -> D) independently, differing only in
the model id and whether gene rules were attached. Move that construction into a new
tests/conftest.py as linear_chain_model / linear_chain_model_with_genes fixtures; the
three files now reuse it (test bodies unchanged). The bespoke _toy_ftinit_model stays
local. No behaviour change.
@edkerk edkerk merged commit f6b6d84 into develop Jun 10, 2026
6 checks passed
@edkerk edkerk deleted the test/conftest-linear-chain branch June 10, 2026 07:44
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