Share the linear-chain INIT model fixture via tests/conftest.py#27
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tier-2 cleanup: dedupe the duplicated INIT model fixture into a shared
tests/conftest.py.test_init.py,test_init_build.pyandtest_init_solvers.pyeach built the samelinear-chain INIT model (
EX_A -> A -> B -> C -> D, reactionsEX_A/r1/r2/r3)independently — three copies differing only in the model id and whether gene rules
g1/g2/g3were attached.This extracts that construction into one place:
tests/conftest.py(new) provideslinear_chain_modelandlinear_chain_model_with_genesfixtures (one private builder behind both).test_init.py/test_init_build.pykeep theirmodelfixture name (so the testbodies are untouched) but now just return the shared fixture.
test_init_solvers.pydrops its_toy_init_model()helper; the one test that used itinjects
linear_chain_model. Its bespoke_toy_ftinit_modelis 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) andruff checkgreen; no behaviour change (same models, sameassertions).