Skip to content

Inconsistent behavior of the desc argument in testthat::test_file(desc=...) #2118

@kubajal

Description

@kubajal

There are 2 consistency issues with test_file(desc=...):

  • you can't select a nested describe expression (and their nesting is allowed as per https://testthat.r-lib.org/reference/describe.html)
  • you can't select a single it statement for execution (analogously to how you are able to select a single test_that or describe expression)

Implementing more granular selection of tests that the user wants to run would improve the UX of testthat. Additionally, better IDE integrations would be possible (e.g. fixing an old issue in meakbiyik/vscode-r-test-adapter#24 which I'm working on).

I have partially implemented the more granular way to run the tests in #2077 but it was rejected. Moreover, I'm aware now of 1 bug in my code which I want to fix. I can't however reopen that PR.

I'll appreciate any input on that topic from the maintainers side. I'm ready to properly implement it.

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