@@ -110,6 +110,7 @@ def venv(self, **venv_create_args):
110
110
** venv_create_args ,
111
111
)
112
112
113
+
113
114
def test_get_path_names (self ):
114
115
self .assertEqual (get_path_names (), sysconfig ._SCHEME_KEYS )
115
116
@@ -591,71 +592,6 @@ def test_osx_ext_suffix(self):
591
592
suffix = sysconfig .get_config_var ('EXT_SUFFIX' )
592
593
self .assertTrue (suffix .endswith ('-darwin.so' ), suffix )
593
594
594
- @requires_subprocess ()
595
- def test_config_vars_depend_on_site_initialization (self ):
596
- script = textwrap .dedent ("""
597
- import sysconfig
598
-
599
- config_vars = sysconfig.get_config_vars()
600
-
601
- import json
602
- print(json.dumps(config_vars, indent=2))
603
- """ )
604
-
605
- with self .venv () as venv :
606
- site_config_vars = json .loads (venv .run ('-c' , script ).stdout )
607
- no_site_config_vars = json .loads (venv .run ('-S' , '-c' , script ).stdout )
608
-
609
- self .assertNotEqual (site_config_vars , no_site_config_vars )
610
- # With the site initialization, the virtual environment should be enabled.
611
- self .assertEqual (site_config_vars ['base' ], venv .prefix )
612
- self .assertEqual (site_config_vars ['platbase' ], venv .prefix )
613
- #self.assertEqual(site_config_vars['prefix'], venv.prefix) # # FIXME: prefix gets overwriten by _init_posix
614
- # Without the site initialization, the virtual environment should be disabled.
615
- self .assertEqual (no_site_config_vars ['base' ], site_config_vars ['installed_base' ])
616
- self .assertEqual (no_site_config_vars ['platbase' ], site_config_vars ['installed_platbase' ])
617
-
618
- @requires_subprocess ()
619
- def test_config_vars_recalculation_after_site_initialization (self ):
620
- script = textwrap .dedent ("""
621
- import sysconfig
622
-
623
- before = sysconfig.get_config_vars()
624
-
625
- import site
626
- site.main()
627
-
628
- after = sysconfig.get_config_vars()
629
-
630
- import json
631
- print(json.dumps({'before': before, 'after': after}, indent=2))
632
- """ )
633
-
634
- with self .venv () as venv :
635
- config_vars = json .loads (venv .run ('-S' , '-c' , script ).stdout )
636
-
637
- self .assertNotEqual (config_vars ['before' ], config_vars ['after' ])
638
- self .assertEqual (config_vars ['after' ]['base' ], venv .prefix )
639
- #self.assertEqual(config_vars['after']['prefix'], venv.prefix) # FIXME: prefix gets overwriten by _init_posix
640
- #self.assertEqual(config_vars['after']['exec_prefix'], venv.prefix) # FIXME: exec_prefix gets overwriten by _init_posix
641
-
642
- @requires_subprocess ()
643
- def test_paths_depend_on_site_initialization (self ):
644
- script = textwrap .dedent ("""
645
- import sysconfig
646
-
647
- paths = sysconfig.get_paths()
648
-
649
- import json
650
- print(json.dumps(paths, indent=2))
651
- """ )
652
-
653
- with self .venv () as venv :
654
- site_paths = json .loads (venv .run ('-c' , script ).stdout )
655
- no_site_paths = json .loads (venv .run ('-S' , '-c' , script ).stdout )
656
-
657
- self .assertNotEqual (site_paths , no_site_paths )
658
-
659
595
@requires_subprocess ()
660
596
def test_makefile_overwrites_config_vars (self ):
661
597
script = textwrap .dedent ("""
@@ -689,7 +625,6 @@ def test_makefile_overwrites_config_vars(self):
689
625
self .assertNotEqual (data ['prefix' ], data ['base_prefix' ])
690
626
self .assertNotEqual (data ['exec_prefix' ], data ['base_exec_prefix' ])
691
627
692
-
693
628
class MakefileTests (unittest .TestCase ):
694
629
695
630
@unittest .skipIf (sys .platform .startswith ('win' ),
0 commit comments