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

Method test_simple_builtin_objects

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

Source from the content-addressed store, hash-verified

869 ])
870
871 def test_simple_builtin_objects(self):
872 self.assert_roundtrip_equal([
873 # int
874 *range(-1, 258),
875 sys.maxsize + 1,
876 sys.maxsize,
877 -sys.maxsize - 1,
878 -sys.maxsize - 2,
879 2**1000,
880 # complex
881 1+2j,
882 # float
883 0.0,
884 1.1,
885 -1.0,
886 0.12345678,
887 -0.12345678,
888 # bytes
889 *(i.to_bytes(2, 'little', signed=True)
890 for i in range(-1, 258)),
891 b'hello world',
892 # str
893 'hello world',
894 '你好世界',
895 '',
896 ])
897 self.assert_not_shareable([
898 OBJECT,
899 types.SimpleNamespace(),
900 ])
901
902 def test_bytearray(self):
903 # bytearray is special because it unmarshals to bytes, not bytearray.

Callers

nothing calls this directly

Calls 2

assert_not_shareableMethod · 0.80

Tested by

no test coverage detected