diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_cmd_line_script.py | 5 | ||||
-rw-r--r-- | Lib/test/test_embed.py | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index 2ac926d..adfb8ce 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -223,12 +223,13 @@ class CmdLineTest(unittest.TestCase): def test_script_abspath(self): # pass the script using the relative path, expect the absolute path - # in __file__ and sys.argv[0] + # in __file__ with support.temp_cwd() as script_dir: self.assertTrue(os.path.isabs(script_dir), script_dir) script_name = _make_test_script(script_dir, 'script') - self._check_script(os.path.basename(script_name), script_name, script_name, + relative_name = os.path.basename(script_name) + self._check_script(relative_name, script_name, relative_name, script_dir, None, importlib.machinery.SourceFileLoader) diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index b87863a..60f7f7a 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -858,10 +858,9 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): preconfig = { 'allocator': PYMEM_ALLOCATOR_DEBUG, } - script_abspath = os.path.abspath('script.py') config = { - 'argv': [script_abspath], - 'run_filename': script_abspath, + 'argv': ['script.py'], + 'run_filename': os.path.abspath('script.py'), 'dev_mode': 1, 'faulthandler': 1, 'warnoptions': ['default'], |