Skip to content

Coverage files are created for anonymous functions in package tests… #45810

Open
@mbauman

Description

@mbauman

… if the anonymous function is called by code defined in the package and (edit: this is no longer true on master) if the anonymous function is defined outside of a @test macro.

Typically coverage is not reported for lines in test files at all. But in this particular case, you end up with spurious .cov files in your test folder. Not a huge deal, and can generally be ignored, but we are otherwise so consistent about ignoring such coverage lines that this edge case feels a little buggy.

MWE: https://github.com/mbauman/TestTestCov, with tests run simply by activating the package environment and doing a ]test --coverage. If myall were only called inside @test macros, no .cov file would be created in the test folder at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions