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

Method test_parametrize_multiple_times

testing/python/metafunc.py:901–916  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

899 assert metafunc._calls[1].id == "3-4"
900
901 def test_parametrize_multiple_times(self, pytester: Pytester) -> None:
902 pytester.makepyfile(
903 """
904 import pytest
905 pytestmark = pytest.mark.parametrize("x", [1,2])
906 def test_func(x):
907 assert 0, x
908 class TestClass(object):
909 pytestmark = pytest.mark.parametrize("y", [3,4])
910 def test_meth(self, x, y):
911 assert 0, x
912 """
913 )
914 result = pytester.runpytest()
915 assert result.ret == 1
916 result.assert_outcomes(failed=6)
917
918 def test_parametrize_CSV(self, pytester: Pytester) -> None:
919 pytester.makepyfile(

Callers

nothing calls this directly

Calls 3

assert_outcomesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected