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

Method assert_not_shareable

Lib/test/test_crossinterp.py:506–513  ·  view source on GitHub ↗
(self, values, exctype=None, *, mode=None)

Source from the content-addressed store, hash-verified

504 self.assertNotEqual(got, obj)
505
506 def assert_not_shareable(self, values, exctype=None, *, mode=None):
507 mode = self._resolve_mode(mode)
508 for obj in values:
509 with self.subTest(repr(obj)):
510 with self.assertRaises(NotShareableError) as cm:
511 _testinternalcapi.get_crossinterp_data(obj, mode)
512 if exctype is not None:
513 self.assertIsInstance(cm.exception.__cause__, exctype)
514
515 def _resolve_mode(self, mode):
516 if mode is None:

Calls 4

_resolve_modeMethod · 0.95
assertIsInstanceMethod · 0.80
subTestMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected