Skip to content

R CMD check failure #94

Description

@Andrew-Acker125

We've been running R CMD check on packages for our package registry manager PRISM (Home | PRISM) and noticed that httptest is failing during tests with 1 failure. The test passes when using testthat 3.2.3, so this appears related to changes in testthat 3.3.2.

The full error output:

checking tests Running testthat.R
Running the tests in tests/testthat.R failed.
Last 13 lines of output:
 TODO: prettify when simplify=FALSE (1): 'test-capture-requests.R:189:5'
 This should skip (1): 'test-offline.R:12:7'
 third_edition is TRUE (2): 'test-expect-header.R:64:7', 'test-without-internet.R:73:7'

 Failed tests

 Failure ('test-expect-header.R:120:5'): expect_header works with actual network too

 Expected 0 successes and 1 failure.
 x Observed 1 success.
 v Observed 1 failure.
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 312 ]
Error: ! Test failures. Execution halted

The test uses expect_failure() which expects 0 successes and 1 failure from the nested expectations, but is showing 1 success and 1 failure.
Here is the failing test:

expect_failure(expect_warning(
  expect_header(
    GET(
      "http://httpbin.org/get",
      config = add_headers(Accept = "image/png")
    ),
    "Accept: image/jpeg"
  ),
  "Accept: image/png"
))

Happy to provide any more details or clarity if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions