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.
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.