Skip to content

Create template for pytest sample data fixtures #863

@genedan

Description

@genedan

Consider the repeated executions of setting/unsetting the backend to numpy, and loading the triangle, and yielding:

@pytest.fixture
def raa(request):
if request.param == "sparse_only_run":
cl.options.set_option("ARRAY_BACKEND", "sparse")
else:
cl.options.set_option("ARRAY_BACKEND", "numpy")
return cl.load_sample("raa")
@pytest.fixture
def qtr(request):
if request.param == "sparse_only_run":
cl.options.set_option("ARRAY_BACKEND", "sparse")
else:
cl.options.set_option("ARRAY_BACKEND", "numpy")
return cl.load_sample("quarterly")

This is repeated per sample data set. A template can be created that each data set can use so we can alter the template and propagate to the fixtures rather than update each one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions