Skip to content

testthat 3.1.8

Compare
Choose a tag to compare
@hadley hadley released this 04 May 13:36
  • expect_snapshot() differences no longer use quotes.

  • expect_error(), expect_warning(), and expect_message() now correctly
    enforce that the condition is of the expected base class (e.g. error,
    warning, messsage) even when the class argument is used (#1168).

  • it() now calls local_test_context() so that it behaves more
    similarly to test_that() (#1731), and is now exported so that you
    can more easily run BDD tests interactively (#1587)

  • skip_on_bioc() now uses the documented environment variable
    (IS_BIOC_BUILD_MACHINE) (#1712).

  • source_file(), which is used by various parts of the helper and
    setup/teardown machinery, now reports the file name in the case of
    errors (#1704).

  • test_path() now works when called within helper files (#1562).

  • New vignette("special-files") describes the various special files
    that testthat uses (#1638).

  • with_mocked_bindings() and local_mocked_bindings() now also bind in the
    imports namespace and can mock S3 methods. These changes make them good
    substitutes for the deprecated functions with_mock() and local_mock(), so
    those older functions now recommend switching to the newer equivalents
    instead of using the mockr or mockery packages.