Module Expr Str Import alias ImportFrom alias alias alias ImportFrom alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias If CompareIn Str AttributeLoad NameLoad attr body Import alias orelse Raise Call AttributeLoad NameLoad attr Str If BoolOpAnd AttributeLoad NameLoad attr UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign SubscriptStore AttributeLoad NameLoad attr Slice AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore TupleLoad Str Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If CompareEq NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr For NameStore ListComp SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num comprehension NameStore AttributeLoad NameLoad attr BoolOpAnd NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad BinOpMod Str TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpMod Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Index Num AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad TryFinally body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad finalbody Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore BinOpAdd NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Lambda arguments args defaults Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str With Call NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Call NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str With Call NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Call NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str With Call NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Call NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str decorator_list Call AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr Str Str FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad TryFinally body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad finalbody Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr Str BinOpMod Str NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Num BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr Str Str BinOpMod Str NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign SubscriptStore NameLoad Index Str Str Assign NameStore Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr Str BinOpMod Str NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign SubscriptStore NameLoad Index Str Str Assign NameStore Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr Str Str keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Num decorator_list Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Import alias Assign AttributeStore NameLoad attr NameLoad With Call NameLoad NameStore body Assign SubscriptStore NameLoad Index Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr attr Str Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr ListLoad Str Assign NameStore Call AttributeLoad NameLoad attr If CompareIn AttributeLoad NameLoad attr TupleLoad Str Str body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num NameLoad orelse If BoolOpAnd CompareEq AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str body Assign AttributeStore NameLoad attr ListLoad Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Call AttributeLoad NameLoad attr Str SubscriptLoad AttributeLoad NameLoad attr Slice Num Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num NameLoad orelse If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Str BinOpAdd Str SubscriptLoad AttributeLoad NameLoad attr Slice Num Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num NameLoad orelse Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Num Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Str Str body Expr Str Assign AttributeStore NameLoad attr BinOpAdd NameLoad Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str TryFinally body Print NameLoad Str Print NameLoad Str Print NameLoad BinOpMod Str AttributeLoad NameLoad attr Print NameLoad AttributeLoad NameLoad attr Print NameLoad AttributeLoad NameLoad attr finalbody Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Delete SubscriptDel AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr orelse If AttributeLoad NameLoad attr body Assign SubscriptStore AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr AttributeLoad NameLoad attr If Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign SubscriptStore AttributeLoad NameLoad attr Slice AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr For NameStore TupleLoad NameLoad NameLoad NameLoad body TryExcept body Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Continue decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Pass decorator_list Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body If CompareEq AttributeLoad NameLoad attr Str body Import alias If Call AttributeLoad SubscriptLoad Call AttributeLoad NameLoad attr Index Num attr Str body For NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body If CompareEq NameLoad Str body Break orelse Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr UnaryOpNot Call NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body If CompareNotIn Str AttributeLoad NameLoad attr body TryExcept body Import alias handlers ExceptHandler type NameLoad body Pass orelse Expr Call AttributeLoad NameLoad attr Str decorator_list decorator_list FunctionDef arguments args defaults body Expr Call NameLoad NameLoad NameLoad decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A Tests for 'site'.

Tests assume the initial paths in sys.path once the interpreter has begun
executing have not been removed.

 N/A unittest test.test_support run_unittest TESTFN EnvironmentVarGuard test.test_support captured_output N/A __builtin__ N/A os N/A sys N/A re N/A encodings N/A subprocess N/A sysconfig copy copy N/A N/A site N/A sys modules N/A N/A site N/A N/A N/A N/A unittest SkipTest importation of site.py suppressed N/A N/A N/A site ENABLE_USER_SITE N/A N/A N/A N/A os path isdir N/A site USER_SITE N/A N/A N/A N/A os makedirs N/A site USER_SITE N/A N/A N/A site addsitedir N/A site USER_SITE HelperFunctionsTests N/A N/A unittest TestCase N/A N/A Tests for helper functions.

    The setting of the encoding (set using sys.setdefaultencoding) used by
    the Unicode implementation is not tested.

     setUp N/A N/A self N/A N/A N/A Save a copy of sys.path N/A N/A self sys_path N/A N/A sys path N/A N/A N/A self old_base N/A site USER_BASE N/A N/A self old_site N/A site USER_SITE N/A N/A self old_prefixes N/A site PREFIXES N/A N/A self old_vars N/A copy N/A sysconfig _CONFIG_VARS N/A tearDown N/A N/A self N/A N/A N/A Restore sys.path N/A N/A N/A sys path N/A N/A self sys_path N/A N/A site USER_BASE N/A self old_base N/A N/A site USER_SITE N/A self old_site N/A N/A site PREFIXES N/A self old_prefixes N/A N/A sysconfig _CONFIG_VARS N/A self old_vars N/A test_makepath N/A N/A self N/A N/A N/A path_parts N/A Beginning End N/A original_dir N/A N/A N/A os path join path_parts N/A N/A abs_dir norm_dir N/A N/A site makepath path_parts N/A N/A N/A self assertEqual N/A N/A N/A os path abspath original_dir abs_dir N/A N/A original_dir N/A N/A N/A os path normcase original_dir N/A N/A N/A N/A self assertEqual abs_dir norm_dir N/A N/A N/A N/A self assertEqual N/A N/A N/A os path normcase abs_dir norm_dir N/A test_init_pathinfo N/A N/A self N/A N/A N/A dir_set N/A N/A site _init_pathinfo N/A entry N/A N/A N/A N/A site makepath path N/A 1 N/A path N/A sys path N/A path N/A N/A N/A os path isdir path N/A N/A N/A N/A self assertIn entry dir_set N/A %s from sys.path not found in set returned by _init_pathinfo(): %s N/A entry dir_set N/A pth_file_tests N/A N/A self pth_file N/A N/A N/A Contain common code for testing results of reading a .pth file N/A N/A N/A self assertIn N/A pth_file imported N/A sys modules N/A %s not in sys.modules N/A pth_file imported N/A N/A N/A self assertIn N/A N/A N/A site makepath N/A pth_file good_dir_path N/A 0 N/A sys path N/A N/A N/A self assertFalse N/A N/A N/A os path exists N/A pth_file bad_dir_path N/A test_addpackage N/A N/A self N/A N/A N/A pth_file N/A PthFile N/A N/A N/A pth_file cleanup prep True N/A N/A N/A N/A N/A pth_file create N/A N/A N/A site addpackage N/A pth_file base_dir N/A pth_file filename N/A set N/A N/A N/A self pth_file_tests pth_file N/A N/A N/A N/A pth_file cleanup N/A make_pth N/A N/A self contents pth_dir pth_name N/A . TESTFN N/A N/A pth_dir N/A N/A N/A os path abspath pth_dir N/A pth_basename N/A pth_name .pth N/A pth_fn N/A N/A N/A os path join pth_dir pth_basename N/A pth_file N/A open pth_fn w N/A N/A N/A self addCleanup N/A N/A N/A N/A N/A N/A os remove pth_fn N/A N/A N/A pth_file write contents N/A N/A N/A pth_file close N/A N/A pth_dir pth_basename N/A test_addpackage_import_bad_syntax N/A N/A self N/A N/A N/A N/A pth_dir pth_fn N/A N/A self make_pth import bad)syntax
 N/A N/A captured_output stderr err_out N/A N/A N/A N/A site addpackage pth_dir pth_fn N/A set N/A N/A N/A self assertRegexpMatches N/A N/A err_out getvalue line 1 N/A N/A N/A self assertRegexpMatches N/A N/A err_out getvalue N/A N/A re escape N/A N/A N/A os path join pth_dir pth_fn N/A N/A N/A self assertRegexpMatches N/A N/A err_out getvalue Traceback N/A N/A N/A self assertRegexpMatches N/A N/A err_out getvalue import bad\)syntax N/A N/A N/A self assertRegexpMatches N/A N/A err_out getvalue SyntaxError N/A test_addpackage_import_bad_exec N/A N/A self N/A N/A N/A N/A pth_dir pth_fn N/A N/A self make_pth randompath
import nosuchmodule
 N/A N/A captured_output stderr err_out N/A N/A N/A N/A site addpackage pth_dir pth_fn N/A set N/A N/A N/A self assertRegexpMatches N/A N/A err_out getvalue line 2 N/A N/A N/A self assertRegexpMatches N/A N/A err_out getvalue N/A N/A re escape N/A N/A N/A os path join pth_dir pth_fn N/A N/A N/A self assertRegexpMatches N/A N/A err_out getvalue Traceback N/A N/A N/A self assertRegexpMatches N/A N/A err_out getvalue ImportError N/A test_addpackage_import_bad_pth_file N/A N/A self N/A N/A N/A N/A pth_dir pth_fn N/A N/A self make_pth abcdef
 N/A N/A captured_output stderr err_out N/A N/A N/A N/A site addpackage pth_dir pth_fn N/A set N/A N/A N/A self assertRegexpMatches N/A N/A err_out getvalue line 1 N/A N/A N/A self assertRegexpMatches N/A N/A err_out getvalue N/A N/A re escape N/A N/A N/A os path join pth_dir pth_fn N/A N/A N/A self assertRegexpMatches N/A N/A err_out getvalue Traceback N/A N/A N/A self assertRegexpMatches N/A N/A err_out getvalue TypeError N/A N/A N/A unittest skipIf N/A N/A sys platform win32 Windows does not raise an error for file paths containing null characters test_addsitedir N/A N/A self N/A N/A N/A pth_file N/A PthFile N/A N/A N/A pth_file cleanup prep True N/A N/A N/A N/A N/A pth_file create N/A N/A N/A site addsitedir N/A pth_file base_dir N/A set N/A N/A N/A self pth_file_tests pth_file N/A N/A N/A N/A pth_file cleanup N/A test_s_option N/A N/A self N/A N/A N/A usersite N/A site USER_SITE N/A N/A N/A self assertIn usersite N/A sys path N/A env N/A N/A N/A os environ copy N/A rc N/A N/A subprocess call N/A N/A sys executable -c N/A import sys; sys.exit(%r in sys.path) usersite env env N/A N/A N/A self assertEqual rc 1 N/A %r is not in sys.path (sys.exit returned %r) N/A usersite rc N/A env N/A N/A N/A os environ copy N/A rc N/A N/A subprocess call N/A N/A sys executable -s -c N/A import sys; sys.exit(%r in sys.path) usersite env env N/A N/A N/A self assertEqual rc 0 N/A env N/A N/A N/A os environ copy N/A N/A env N/A PYTHONNOUSERSITE 1 N/A rc N/A N/A subprocess call N/A N/A sys executable -c N/A import sys; sys.exit(%r in sys.path) usersite env env N/A N/A N/A self assertEqual rc 0 N/A env N/A N/A N/A os environ copy N/A N/A env N/A PYTHONUSERBASE /tmp N/A rc N/A N/A subprocess call N/A N/A sys executable -c import sys, site; sys.exit(site.USER_BASE.startswith("/tmp")) env env N/A N/A N/A self assertEqual rc 1 N/A N/A N/A unittest skipUnless N/A site ENABLE_USER_SITE requires access to PEP 370 user-site (site.ENABLE_USER_SITE) test_getuserbase N/A N/A self N/A N/A N/A N/A site USER_BASE None N/A user_base N/A N/A site getuserbase N/A N/A N/A self assertEqual N/A site USER_BASE user_base N/A N/A site USER_BASE None N/A sysconfig N/A N/A sysconfig _CONFIG_VARS None N/A N/A EnvironmentVarGuard environ N/A N/A N/A environ N/A PYTHONUSERBASE xoxo N/A N/A N/A self assertTrue N/A N/A N/A N/A site getuserbase startswith xoxo N/A N/A site getuserbase N/A test_getusersitepackages N/A N/A self N/A N/A N/A N/A site USER_SITE None N/A N/A site USER_BASE None N/A user_site N/A N/A site getusersitepackages N/A N/A N/A self assertEqual N/A site USER_SITE user_site N/A N/A N/A self assertTrue N/A N/A user_site startswith N/A site USER_BASE user_site N/A test_getsitepackages N/A N/A self N/A N/A N/A N/A site PREFIXES N/A xoxo N/A dirs N/A N/A site getsitepackages N/A N/A N/A sys platform N/A os2emx riscos N/A N/A N/A N/A self assertEqual N/A len dirs 1 N/A wanted N/A N/A N/A os path join xoxo Lib site-packages N/A N/A N/A self assertEqual N/A dirs N/A 0 wanted N/A N/A N/A N/A N/A sys platform darwin N/A N/A sysconfig get_config_var PYTHONFRAMEWORK N/A N/A N/A site PREFIXES N/A Python.framework N/A dirs N/A N/A site getsitepackages N/A N/A N/A self assertEqual N/A len dirs 3 N/A wanted N/A N/A N/A os path join /Library N/A N/A sysconfig get_config_var PYTHONFRAMEWORK N/A N/A sys version N/A 3 site-packages N/A N/A N/A self assertEqual N/A dirs N/A 2 wanted N/A N/A N/A N/A os sep / N/A N/A N/A N/A self assertEqual N/A len dirs 2 N/A wanted N/A N/A N/A os path join xoxo lib N/A python N/A N/A sys version N/A 3 site-packages N/A N/A N/A self assertEqual N/A dirs N/A 0 wanted N/A wanted N/A N/A N/A os path join xoxo lib site-python N/A N/A N/A self assertEqual N/A dirs N/A 1 wanted N/A N/A N/A N/A self assertEqual N/A len dirs 2 N/A N/A N/A self assertEqual N/A dirs N/A 0 xoxo N/A wanted N/A N/A N/A os path join xoxo lib site-packages N/A N/A N/A self assertEqual N/A dirs N/A 1 wanted N/A N/A PthFile N/A object N/A N/A Helper class for handling testing of .pth files __init__ N/A N/A self filename_base imported good_dirname bad_dirname N/A TESTFN time __testdir__ __bad N/A N/A Initialize instance variables N/A N/A self filename N/A filename_base .pth N/A N/A self base_dir N/A N/A N/A os path abspath N/A N/A self file_path N/A N/A N/A os path join N/A self base_dir N/A self filename N/A N/A self imported imported N/A N/A self good_dirname good_dirname N/A N/A self bad_dirname bad_dirname N/A N/A self good_dir_path N/A N/A N/A os path join N/A self base_dir N/A self good_dirname N/A N/A self bad_dir_path N/A N/A N/A os path join N/A self base_dir N/A self bad_dirname N/A create N/A N/A self N/A N/A N/A Create a .pth file with a comment, blank lines, an ``import
        <self.imported>``, a line with self.good_dirname, and a line with
        self.bad_dirname.

        Creation of the directory for self.good_dir_path (based off of
        self.good_dirname) is also performed.

        Make sure to call self.cleanup() to undo anything done by this method.

         N/A FILE N/A open N/A self file_path w N/A N/A N/A FILE #import @bad module name N/A FILE N/A FILE N/A import %s N/A self imported N/A FILE N/A self good_dirname N/A FILE N/A self bad_dirname N/A N/A N/A N/A FILE close N/A N/A N/A os mkdir N/A self good_dir_path N/A cleanup N/A N/A self prep N/A False N/A N/A Make sure that the .pth file is deleted, self.imported is not in
        sys.modules, and that both self.good_dirname and self.bad_dirname are
        not existing directories. N/A N/A N/A N/A os path exists N/A self file_path N/A N/A N/A N/A os remove N/A self file_path N/A prep N/A N/A N/A self imported_module N/A N/A N/A sys modules get N/A self imported N/A N/A self imported_module N/A N/A N/A N/A sys modules N/A N/A self imported N/A N/A N/A self imported_module N/A N/A N/A N/A sys modules N/A N/A self imported N/A self imported_module N/A N/A N/A N/A os path exists N/A self good_dir_path N/A N/A N/A N/A os rmdir N/A self good_dir_path N/A N/A N/A N/A os path exists N/A self bad_dir_path N/A N/A N/A N/A os rmdir N/A self bad_dir_path N/A N/A ImportSideEffectTests N/A N/A unittest TestCase N/A N/A Test side-effects from importing 'site'. setUp N/A N/A self N/A N/A N/A Make a copy of sys.path N/A N/A self sys_path N/A N/A sys path N/A N/A tearDown N/A N/A self N/A N/A N/A Restore sys.path N/A N/A N/A sys path N/A N/A self sys_path N/A test_abs__file__ N/A N/A self N/A N/A N/A N/A N/A site abs__file__ N/A module N/A sys os __builtin__ N/A N/A N/A N/A N/A N/A self assertTrue N/A N/A N/A os path isabs N/A module __file__ N/A repr module N/A N/A N/A AttributeError N/A N/A N/A test_no_duplicate_paths N/A N/A self N/A N/A N/A N/A N/A site removeduppaths N/A seen_paths N/A set N/A path N/A sys path N/A N/A N/A N/A self assertNotIn path seen_paths N/A N/A N/A seen_paths add path N/A test_add_build_dir N/A N/A self N/A N/A N/A N/A N/A N/A unittest skip test not implemented test_setting_quit N/A N/A self N/A N/A N/A N/A N/A self assertTrue N/A hasattr __builtin__ quit N/A N/A N/A self assertTrue N/A hasattr __builtin__ exit N/A test_setting_copyright N/A N/A self N/A N/A N/A N/A N/A self assertTrue N/A hasattr __builtin__ copyright N/A N/A N/A self assertTrue N/A hasattr __builtin__ credits N/A test_setting_help N/A N/A self N/A N/A N/A N/A N/A self assertTrue N/A hasattr __builtin__ help N/A test_aliasing_mbcs N/A N/A self N/A N/A N/A N/A N/A sys platform win32 N/A N/A locale N/A N/A N/A N/A N/A N/A locale getdefaultlocale N/A 1 startswith cp N/A N/A value N/A N/A N/A N/A encodings aliases aliases itervalues N/A N/A N/A value mbcs N/A N/A N/A N/A N/A N/A self fail did not alias mbcs N/A test_setdefaultencoding_removed N/A N/A self N/A N/A N/A N/A N/A self assertTrue N/A N/A hasattr sys setdefaultencoding N/A test_sitecustomize_executed N/A N/A self N/A N/A N/A N/A sitecustomize N/A sys modules N/A N/A N/A N/A sitecustomize N/A N/A N/A ImportError N/A N/A N/A N/A N/A N/A self fail sitecustomize not imported automatically N/A N/A test_main N/A N/A N/A N/A N/A N/A run_unittest HelperFunctionsTests ImportSideEffectTests N/A N/A N/A __name__ __main__ N/A N/A N/A test_main