-
Notifications
You must be signed in to change notification settings - Fork 10
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
with_mock_api() does not fully clean up (untrace) #66
Comments
It looks like
There should be the same number of "Untracing" as "Tracing". You may be able to work around this by adding an explicit
|
@nealrichardson
since
please, do you have any clue how to fix it? I don't want change to |
But So a PR to fix this would add the missing calls to |
was also hit by that. will try to do a PR... |
i have a test where i use httptest like this
test_that("check list parameter", {
httptest::with_mock_api({
expect_error(testClient$getMatrixData(c(10)), regexp = "listOfMatrixNames needs to be a vector of strings")
expect_error(testClient$getMatrixData(10), regexp = "listOfMatrixNames needs to be a vector of strings")
expect_error(testClient$getMatrixData("10", 10), regexp = "repository needs to be a string")
expect_error(testClient$getMatrixData("bla"), regexp = "POST.")
expect_error(testClient$getMatrixData(c("bla", "blub")), regexp = "POST.")
})
})
and that works fine. i have also tests where i do real http request but if they run together in the same R session the real connection tests start throwing exception like this.
Error in readBin(con, "raw", nbytes) : invalid connection
That happens when uploading files using httr::upload_file(). i have to restart the session to make the integration tests pass again.
I include library("httptest") in setup.R (which is used by both, integration tests and mock tests)
R version: 4.1.0
Httr: 1.4.2
Httptest: 4.1.0
my crazy wild guess:
httr::POST is missing here?
httptest/R/trace.R
Line 32 in 5048d8e
The text was updated successfully, but these errors were encountered: