(self)
| 712 | |
| 713 | @support.requires_subprocess() |
| 714 | def test_underpth_basic(self): |
| 715 | pth_lines = ['#.', '# ..', *sys.path, '.', '..'] |
| 716 | exe_file = self._create_underpth_exe(pth_lines) |
| 717 | sys_path = self._calc_sys_path_for_underpth_nosite( |
| 718 | os.path.dirname(exe_file), |
| 719 | pth_lines) |
| 720 | |
| 721 | output = subprocess.check_output([exe_file, '-X', 'utf8', '-c', |
| 722 | 'import sys; print("\\n".join(sys.path) if sys.flags.no_site else "")' |
| 723 | ], encoding='utf-8', errors='surrogateescape') |
| 724 | actual_sys_path = output.rstrip().split('\n') |
| 725 | self.assertTrue(actual_sys_path, "sys.flags.no_site was False") |
| 726 | self.assertEqual( |
| 727 | actual_sys_path, |
| 728 | sys_path, |
| 729 | "sys.path is incorrect" |
| 730 | ) |
| 731 | |
| 732 | @support.requires_subprocess() |
| 733 | def test_underpth_nosite_file(self): |
nothing calls this directly
no test coverage detected