Skip to content

local_mock() #856

@jennybc

Description

@jennybc

Most withr functions have a with_() variant and a local_() variant. The local_() variant is especially appealing with multi-line expressions, so you don't have to nest lots of logic inside the with_() call.

I would like a similar alternative for with_mock() inside a test, i.e. the ability to put a local_mock() in place that will be cleared when it goes out of scope. Is that possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions