Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

context

Describe the context of a set of tests.


Description

[Superseded]

Use of context() is no longer recommended. Instead omit it, and messages will use the name of the file instead. This ensures that the context and test file name are always in sync.

A context defines a set of tests that test related functionality. Usually you will have one context per file, but you may have multiple contexts in a single file if you so choose.

Usage

context(desc)

Arguments

desc

description of context. Should start with a capital letter.

3rd edition

[Deprecated]

context() is deprecated in the third edition, and the equivalent information is instead recorded by the test file name.

Examples

context("String processing")
context("Remote procedure calls")

testthat

Unit Testing for R

v3.0.2
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], RStudio [cph, fnd], R Core team [ctb] (Implementation of utils::recover())
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.