Skip to content

Extract all functions and objects used in tests into functions in the R/ directory or into testthat helpers #2793

Open

Description

@krlmlr

Rationale: Make each test_that() block run independently without having to run setup code.

Example: tarjan_yannakakis_graph

Activity

  1. maelle commented on Aug 12, 2026

    @maelle
    Contributor

    But load_all() loads helper files? And why have code useful only for tests in R/?

  2. changed the title [-]Extract all functions and objects used in tests into functions in the `R/` directory[/-] [+]Extract all functions and objects used in tests into functions in the `R/` directory or into testthat helpers[/+] on Aug 15, 2026
  3. krlmlr commented on Aug 15, 2026

    @krlmlr
    ContributorAuthor

    Moving from helpers to R/ is a separate discussion. This is just about not having setup code sit loosely in test files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions