Skip to content

Testing fixtures to limit shared dataset state across tests #2041

@fluidnumericsJoe

Description

@fluidnumericsJoe

In some of our tests, we've found it useful to use the built-in generic datasets for structured and unstructured grids. In some cases, these datasets are modified (e.g. to turn a constant field to a linearly varying field and develop correctness/verification tests ).

The problem is that this can cause "test pollution" (see #2032 (comment) for discussion) if not done carefully. The source of the problem is that the generic datasets we are leveraging have global scope in the context of the tests; modifying a dataset that is global scope can alter the state of tests that are executed later.

The current solution we have is to leverage deep copies of the dataset within tests that require modification. In discussion, we are leaning towards requiring using fixtures that reference the methods use to generate the datasets, rather than the global scope dictionaries that reference the datasets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions