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

Method test_getuserbase

Lib/test/test_site.py:298–312  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

296
297 @unittest.skipUnless(HAS_USER_SITE, 'need user site')
298 def test_getuserbase(self):
299 site.USER_BASE = None
300 user_base = site.getuserbase()
301
302 # the call sets site.USER_BASE
303 self.assertEqual(site.USER_BASE, user_base)
304
305 # let's set PYTHONUSERBASE and see if it uses it
306 site.USER_BASE = None
307 import sysconfig
308 sysconfig._CONFIG_VARS = None
309
310 with EnvironmentVarGuard() as environ:
311 environ['PYTHONUSERBASE'] = 'xoxo'
312 self.assertStartsWith(site.getuserbase(), 'xoxo')
313
314 @unittest.skipUnless(HAS_USER_SITE, 'need user site')
315 def test_getusersitepackages(self):

Callers

nothing calls this directly

Calls 3

EnvironmentVarGuardClass · 0.90
assertStartsWithMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected