#NEWLINE# @ unittest . skipIf ( is_jython , 'FIXME: not on Jython yet.' ) #NEWLINE# @ unittest . skipUnless ( site . ENABLE_USER_SITE , 'requires access to PEP 370 user-site (site.ENABLE_USER_SITE)' ) #NEWLINE# def test_s_option( self ) : #NEWLINE# #INDENT# usersite = site . USER_SITE #NEWLINE# self . assertIn ( usersite , sys . path ) #NEWLINE# env = os . environ . copy ( ) #NEWLINE# rc = subprocess . call ( [ sys . executable , '-c' , ( 'import sys; sys.exit(%r in sys.path)' % usersite ) ] , env = env ) #NEWLINE# self . assertEqual ( rc , 1 , ( '%r is not in sys.path (sys.exit returned %r)' % ( usersite , rc ) ) ) #NEWLINE# env = os . environ . copy ( ) #NEWLINE# rc = subprocess . call ( [ sys . executable , '-s' , '-c' , ( 'import sys; sys.exit(%r in sys.path)' % usersite ) ] , env = env ) #NEWLINE# self . assertEqual ( rc , 0 ) #NEWLINE# env = os . environ . copy ( ) #NEWLINE# env [ 'PYTHONNOUSERSITE' ] = '1' #NEWLINE# rc = subprocess . call ( [ sys . executable , '-c' , ( 'import sys; sys.exit(%r in sys.path)' % usersite ) ] , env = self ) #NEWLINE# self . assertEqual ( rc , 0 ) #NEWLINE# env = os . environ . copy ( ) #NEWLINE# env [ 'PYTHONUSERBASE' ] = '/tmp' #NEWLINE# rc = subprocess . call ( [ sys . executable , '-c' , 'import sys, site; sys.exit(site.USER_BASE.startswith("/tmp"))' ] , env = env ) #NEWLINE# self . assertEqual ( rc , 1 )