MCPcopy Create free account
hub / github.com/astral-sh/python-build-standalone / TestPythonInterpreter

Class TestPythonInterpreter

pythonbuild/disttests/__init__.py:46–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45
46class TestPythonInterpreter(unittest.TestCase):
47 def test_compression(self):
48 import bz2
49 import lzma
50 import zlib
51
52 self.assertTrue(lzma.is_check_supported(lzma.CHECK_CRC64))
53 self.assertTrue(lzma.is_check_supported(lzma.CHECK_SHA256))
54
55 bz2.compress(b"test")
56 zlib.compress(b"test")
57
58 def test_ctypes(self):
59 import ctypes
60
61 # pythonapi will be None on statically linked binaries.
62 is_static = "static" in os.environ["BUILD_OPTIONS"]
63 if is_static:
64 self.assertIsNone(ctypes.pythonapi)
65 else:
66 self.assertIsNotNone(ctypes.pythonapi)
67
68 # https://bugs.python.org/issue42688
69 @ctypes.CFUNCTYPE(None, ctypes.c_int, ctypes.c_char_p)
70 def error_handler(fif, message):
71 pass
72
73 @unittest.skipIf(os.name == "nt", "curses not available on Windows")
74 def test_curses_import(self):
75 import curses
76
77 assert curses is not None
78
79 @unittest.skipIf(os.name == "nt", "curses not available on Windows")
80 @unittest.skipIf("TERM" not in os.environ, "TERM not set")
81 def test_curses_interactive(self):
82 import curses
83
84 curses.initscr()
85 curses.endwin()
86
87 def test_hashlib(self):
88 import hashlib
89
90 wanted_hashes = {
91 "blake2b",
92 "blake2s",
93 "md5",
94 "md5-sha1",
95 "ripemd160",
96 "sha1",
97 "sha224",
98 "sha256",
99 "sha384",
100 "sha3_224",
101 "sha3_256",
102 "sha3_384",
103 "sha3_512",

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected