MCPcopy
hub / github.com/pytest-dev/pytest / test_serialization_xdist

Function test_serialization_xdist

testing/test_subtests.py:1051–1075  ·  testing/test_subtests.py::test_serialization_xdist

Regression test for pytest-dev/pytest-xdist#1273.

(pytester: pytest.Pytester)

Source from the content-addressed store, hash-verified

1049
1050
1051def test_serialization_xdist(pytester: pytest.Pytester) -> None: class="cm"># pragma: no cover
1052 class="st">""class="st">"Regression test for pytest-dev/pytest-xdistclass="cm">#1273."class="st">""
1053 pytest.importorskip(class="st">"xdist")
1054 pytester.makepyfile(
1055 class="st">"""
1056 from enum import Enum
1057 import unittest
1058
1059 class MyEnum(Enum):
1060 A = class="st">"A"
1061
1062 def test(subtests):
1063 with subtests.test(a=MyEnum.A):
1064 pass
1065
1066 class T(unittest.TestCase):
1067
1068 def test(self):
1069 with self.subTest(a=MyEnum.A):
1070 pass
1071 class="st">"""
1072 )
1073 pytester.syspathinsert()
1074 result = pytester.runpytest(class="st">"-n1", class="st">"-pxdist.plugin")
1075 result.assert_outcomes(passed=2)

Callers

nothing calls this directly

Calls 4

assert_outcomesMethod · 0.80
makepyfileMethod · 0.45
syspathinsertMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected