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

Function test_serialization_xdist

testing/test_subtests.py:1051–1075  ·  view source on GitHub ↗

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: # pragma: no cover
1052 """Regression test for pytest-dev/pytest-xdist#1273."""
1053 pytest.importorskip("xdist")
1054 pytester.makepyfile(
1055 """
1056 from enum import Enum
1057 import unittest
1058
1059 class MyEnum(Enum):
1060 A = "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 """
1072 )
1073 pytester.syspathinsert()
1074 result = pytester.runpytest("-n1", "-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

Used in the wild real call sites across dependent graphs

searching dependent graphs…