MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_fixture_parametrization_nparray

Function test_fixture_parametrization_nparray

testing/python/fixtures.py:4402–4419  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

4400
4401
4402def test_fixture_parametrization_nparray(pytester: Pytester) -> None:
4403 pytest.importorskip("numpy")
4404
4405 pytester.makepyfile(
4406 """
4407 from numpy import linspace
4408 from pytest import fixture
4409
4410 @fixture(params=linspace(1, 10, 10))
4411 def value(request):
4412 return request.param
4413
4414 def test_bug(value):
4415 assert value == value
4416 """
4417 )
4418 result = pytester.runpytest()
4419 result.assert_outcomes(passed=10)
4420
4421
4422def test_fixture_arg_ordering(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

assert_outcomesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected