nealrichardson / httptest

A Test Environment for HTTP Requests in R
https://enpiar.com/r/httptest/
Other
79 stars 10 forks source link

fix #76 by fully qualifying/scoping the httptest function calls in th… #77

Closed kforner closed 1 year ago

kforner commented 1 year ago

fix #76 by fully qualifying/scoping the httptest function calls in the instrumented code.

Tested locally with my use case: I could use httptest in Suggests: instead of in Depends: in my package and it still works as expected. And the tests still pass.

kforner commented 1 year ago

Sure. Quick question: Why aren't you using httr builtin callback feature to capture the requests (set_callback()) ?

nealrichardson commented 1 year ago

I don't recall for sure at this point, but the original implementation of httptest predates that feature in httr, so historically that's why it relies on trace(). There may also be a difference in how request errors are handled--I feel like I tried to switch to use the callbacks at some point and ran into an issue.