Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: decouple test cases #493

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

test: decouple test cases #493

wants to merge 2 commits into from

Conversation

jsstevenson
Copy link
Contributor

close #479

This issue relates to SeqRepo's LRU cache and pytest-VCR.

  • pytest-vcr mocks REST requests on a per-function basis.
  • however, several dataproxy requests recur in multiple test cases.
  • When all tests are run at once, I believe that SeqRepo's LRU cache decorator is caching the response after the first request, and doesn't issue it again in subsequent test cases (because it gets a cache hit).
  • This means that the cassettes for those test cases don't include responses for those requests. If you just run those tests in isolation, you'll be issuing requests that aren't in the cassette, and you'll fail.

One obvious solution is to reconstruct the fixture after every test case (i.e. every test function). However, that kind of sucks and makes running tests far slower (27 seconds on my machine, and that's with a bunch of fails, vs 5 seconds the old way) because there's a little bit of cost to re-create the fixture after every test case. We'll also need to generate new cassettes if we go this route.

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.

Decouple test_cnv_translator and test_allele_translator
1 participant