Skip to content

Adding fixtures to Basis tests #855

Open
@chris-langfield

Description

@chris-langfield

From #818, basis tests are now parametrized over a list of Basis objects instantiated with parameters that are stored in tests/_basis_util, e.g.

test_bases = [FBBasis2D(L, dtype=dtype) for L, dtype in basis_params_2d]

Instead of parametrizing test functions over the basis objects we should parametrize over the parameters themselves and create a fixture(s) to generate the basis objects.

Two things to note:

  • FLEBasis2D FLE Basis #693 parametrizes over a variable the other bases do not, namely epsilon, which is an __init__ parameter
  • This fixture or fixtures will have to interact with the UniversalBasisMixin class in _basis_util. The test functions in that class will have to accept a fixture rather than just a Basis. The fixture could be defined at a very high level in _basis_util.py (giving this class access to it), or the fixtures would have to be made available to it using pytest.fixture(... scope="session") or similar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions