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

Method test_get_preferred_schemes

Lib/test/test_sysconfig.py:143–163  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

141 self.assertIn(get_default_scheme(), _INSTALL_SCHEMES)
142
143 def test_get_preferred_schemes(self):
144 expected_schemes = {'prefix', 'home', 'user'}
145
146 # Windows.
147 os.name = 'nt'
148 schemes = _get_preferred_schemes()
149 self.assertIsInstance(schemes, dict)
150 self.assertEqual(set(schemes), expected_schemes)
151
152 # Mac and Linux, shared library build.
153 os.name = 'posix'
154 schemes = _get_preferred_schemes()
155 self.assertIsInstance(schemes, dict)
156 self.assertEqual(set(schemes), expected_schemes)
157
158 # Mac, framework build.
159 os.name = 'posix'
160 sys.platform = 'darwin'
161 sys._framework = "MyPython"
162 self.assertIsInstance(schemes, dict)
163 self.assertEqual(set(schemes), expected_schemes)
164
165 def test_posix_venv_scheme(self):
166 # The following directories were hardcoded in the venv module

Callers

nothing calls this directly

Calls 4

_get_preferred_schemesFunction · 0.90
setFunction · 0.85
assertIsInstanceMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected