MCPcopy Index your code
hub / github.com/python/cpython / setUpClass

Method setUpClass

Lib/test/test_xpickle.py:102–114  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

100
101 @classmethod
102 def setUpClass(cls):
103 assert cls.py_version is not None, 'Needs a python version tuple'
104 if not have_python_version(cls.py_version):
105 py_version_str = ".".join(map(str, cls.py_version))
106 raise unittest.SkipTest(f'Python {py_version_str} not available')
107 cls.addClassCleanup(cls.finish_worker)
108 # Override the default pickle protocol to match what xpickle worker
109 # will be running.
110 highest_protocol = highest_proto_for_py_version(cls.py_version)
111 cls.enterClassContext(support.swap_attr(pickletester, 'protocols',
112 range(highest_protocol + 1)))
113 cls.enterClassContext(support.swap_attr(pickle, 'HIGHEST_PROTOCOL',
114 highest_protocol))
115
116 @classmethod
117 def start_worker(cls, python):

Callers

nothing calls this directly

Calls 5

have_python_versionFunction · 0.85
addClassCleanupMethod · 0.80
enterClassContextMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected