Skip to content

[RFC] More robust revert functions for convergence tests #636

Open
@Tcc0403

Description

@Tcc0403

🐛 Describe the bug

Many discussions show that the current revert functions have several limitations, including:

Simply reloading the modules would generate new class/function objects different from the original ones, i.e. revert(patch(object)) != object, which can easily lead to bugs when doing comparisons (isinstance()), repatching, reusing configs and so on.

One way to address the issue is having a patch manager for testing to keep track of replaced objects, so we can easily revert back to the original objects after monkey patch. Or is there a way to achieve it with pytest?

cc @tyler-romero @austin362667

Reproduce

No response

Versions

none

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