nealrichardson / httptest

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

Clean up file connections on mocked POST/PUT #29

Closed jonkeane closed 4 years ago

jonkeane commented 4 years ago

When the body of the request is only a form_file (e.g. PUT(url, body = upload_file("./file"))), a connection is opened to the file in body_config() which is not closed until curl::curl_fetch_memory() is called during request_perform(). When using a mocked API, curl::curl_fetch_memory() isn't called, so the connection remains open leading to warnings (typically at the end of the test suite).

codecov-commenter commented 4 years ago

Codecov Report

Merging #29 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #29   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines          427       430    +3     
=========================================
+ Hits           427       430    +3     
Impacted Files Coverage Δ
R/trace.R 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a926d3e...1c0d001. Read the comment docs.

nealrichardson commented 4 years ago

Thanks! Would you mind adding a note to NEWS for this?

nealrichardson commented 4 years ago

Thanks again!