MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_implementation

Method test_implementation

Lib/test/test_sys.py:1067–1097  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1065 self.check_locale_surrogateescape('POSIX')
1066
1067 def test_implementation(self):
1068 # This test applies to all implementations equally.
1069
1070 levels = {'alpha': 0xA, 'beta': 0xB, 'candidate': 0xC, 'final': 0xF}
1071
1072 self.assertHasAttr(sys.implementation, 'name')
1073 self.assertHasAttr(sys.implementation, 'version')
1074 self.assertHasAttr(sys.implementation, 'hexversion')
1075 self.assertHasAttr(sys.implementation, 'cache_tag')
1076 self.assertHasAttr(sys.implementation, 'supports_isolated_interpreters')
1077
1078 version = sys.implementation.version
1079 self.assertEqual(version[:2], (version.major, version.minor))
1080
1081 hexversion = (version.major << 24 | version.minor << 16 |
1082 version.micro << 8 | levels[version.releaselevel] << 4 |
1083 version.serial << 0)
1084 self.assertEqual(sys.implementation.hexversion, hexversion)
1085
1086 # PEP 421 requires that .name be lower case.
1087 self.assertEqual(sys.implementation.name,
1088 sys.implementation.name.lower())
1089
1090 # https://peps.python.org/pep-0734
1091 sii = sys.implementation.supports_isolated_interpreters
1092 self.assertIsInstance(sii, bool)
1093 if test.support.check_impl_detail(cpython=True):
1094 if test.support.is_emscripten or test.support.is_wasi:
1095 self.assertFalse(sii)
1096 else:
1097 self.assertTrue(sii)
1098
1099 @test.support.cpython_only
1100 def test_debugmallocstats(self):

Callers

nothing calls this directly

Calls 6

assertIsInstanceMethod · 0.80
assertFalseMethod · 0.80
assertTrueMethod · 0.80
assertHasAttrMethod · 0.45
assertEqualMethod · 0.45
lowerMethod · 0.45

Tested by

no test coverage detected