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

Method test_not_shareable

Lib/test/test_crossinterp.py:1238–1264  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1236 self.assert_roundtrip_equal(SHAREABLE)
1237
1238 def test_not_shareable(self):
1239 okay = [
1240 *PICKLEABLE,
1241 *defs.STATELESS_FUNCTIONS,
1242 LAMBDA,
1243 ]
1244 ignored = [
1245 *TUPLES_WITHOUT_EQUALITY,
1246 OBJECT,
1247 METHOD,
1248 BUILTIN_METHOD,
1249 METHOD_WRAPPER,
1250 ]
1251 with ignore_byteswarning():
1252 self.assert_roundtrip_equal([
1253 *(o for o in NOT_SHAREABLE
1254 if o in okay and o not in ignored
1255 and o is not MAPPING_PROXY_EMPTY),
1256 ])
1257 self.assert_roundtrip_not_equal([
1258 *(o for o in NOT_SHAREABLE
1259 if o in ignored and o is not MAPPING_PROXY_EMPTY),
1260 ])
1261 self.assert_not_shareable([
1262 *(o for o in NOT_SHAREABLE if o not in okay),
1263 MAPPING_PROXY_EMPTY,
1264 ])
1265
1266
1267class ShareableTypeTests(_GetXIDataTests):

Callers

nothing calls this directly

Calls 4

ignore_byteswarningFunction · 0.85
assert_not_shareableMethod · 0.80

Tested by

no test coverage detected