easy-entrez icon indicating copy to clipboard operation
easy-entrez copied to clipboard

Suggestion: `pytest-vcr` for reliable testing

Open jamesbraza opened this issue 9 months ago • 2 comments

I believe the test suite is actually making requests to Entrez each time it's run.

To fix this, I suggest using pytest-vcr, a pytest plug-in for caching the response of requests in a subfolder of the test folder.

It's very easy to use, and may help with the seeming flakiness of CI at the moment

jamesbraza avatar Nov 02 '23 21:11 jamesbraza

This is a good idea, though it would be best if one of the jobs was not cached (while the other were). Also, requests-cache may be preferable as it is a bit more established.

krassowski avatar Nov 02 '23 21:11 krassowski

Oh wow, requests-cache is a TIL for me, thanks!

And yeah, it's up to you, was just a suggestion as I noticed CI is somewhat flaky.

Maybe instead of caching for all but one job, it'd be more preferable to set up a weekly CI job using schedule that updates the cached responses.

jamesbraza avatar Nov 02 '23 21:11 jamesbraza