Skip to content

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