Skip to content

use a fixture to test brent and newton to eliminate redundant tests in test_pvsystem #499

@mikofski

Description

@mikofski

problem
there is WET code in test_pvsystem.py since I copied and pasted the same tests, and just changed the method

solution
according to this comment here's a nice snippet:

@requires_scipy
@pytest.mark.parametrize('method,atol', [('brentq', 1e-11), ('newton', 1e-8)])
def test_v_from_i_methods(fixture_v_from_i, method, atol):
# remove atol spec and set method=method

Additional context
see #409

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions