Repository navigation
test: decouple test_cnv_translator from test_allele_translator - #703
Open
Sarthakkapadne wants to merge 1 commit into
Open
Sarthakkapadne wants to merge 1 commit into
Sarthakkapadne wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Closes #479
Problem
When running
pytest tests/extras/test_cnv_translator.pyin isolation, all 7 tests fail with:vcr.errors.CannotOverwriteExistingCassetteException: Can't overwrite existing cassette ... because record mode is 'none'This occurred because
test_cnv_translator.pywas usingrest_dataproxywith@pytest.mark.vcr, but no cassettes were recorded for it. The tests only passed whentest_allele_translator.pyran first because its session-scopedrest_dataproxycachedNC_000013.11in memory, silently bypassing VCR network interception in subsequent test files.Solution
tlrfixture intests/extras/test_cnv_translator.pyto usedataproxy(SeqRepoDataProxy) instead ofrest_dataproxy.@pytest.mark.vcrmarkers fromtest_from_hgvs_cx,test_from_hgvs_cn, andtest_from_hgvs_cn_copies_zero.All test inputs in
test_cnv_translator.pyoperate onNC_000013.11, which is already present in the local test SeqRepo (tests/data/seqrepo/latest). This follows the exact pattern used intests/test_vrs_normalize.py:937-938("Present in the test SeqRepo, so these use the local dataproxy fixture and need no cassettes").Verification
pytest tests/extras/test_cnv_translator.pypasses (7/7 in ~0.1s).test_allele_translator.pypasses cleanly (47/47).pytest tests/(224/224 passed, 0 failures).ruff checkandruff format --checkclean.