httptest icon indicating copy to clipboard operation
httptest copied to clipboard

Interaction with memoise

Open maelle opened this issue 2 years ago • 2 comments

Just a note for info (should httptest get discussions?)

I had a case with tests passing on Ubuntu and failing on macOS and Windows. I first thought the mock file was not found despite its being there but it turns out it was not there.

  • Test 1 (test_that()) was creating a mock dir, everything ok.
  • Test 2 (test_that() in the same test file) was creating a mock dir but not all mock files because some of the requests had been memoised.

I'm not even sure what the OS problem was but in conclusion one should pay attention when capturing requests that are memoised. :sweat_smile: Maybe too niche for any doc though?

maelle avatar Apr 27 '22 10:04 maelle

Yeah if you're caching in some other layer, that's going to affect what requests are made, and thus how you test.

nealrichardson avatar Apr 27 '22 15:04 nealrichardson