Skip to content

Commit 8feb3ad

Browse files
committed
Update test on Windows
1 parent 3cc52ef commit 8feb3ad

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

‎Lib/test/test_tools/test_getbuildinfo.py‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def test_get_build_info(self):
6868
(f'main, {date_time}', 'main'))
6969

7070
def test_get_compiler(self):
71-
getcompiler = os.path.join('Programs', '_getcompiler')
71+
GETCOMPILER = 'GETCOMPILER'
7272
MOCK_COMPILER = 'MOCK_COMPILER'
7373
CC = 'gcc -std=c11'
7474

@@ -86,13 +86,17 @@ def test_get_compiler(self):
8686
mock_run_command.side_effect = ('', MOCK_COMPILER)
8787
else:
8888
mock_run_command.return_value = MOCK_COMPILER
89-
compiler = generate_getbuildinfo._get_compiler()
90-
self.assertEqual(compiler, MOCK_COMPILER)
91-
if hostrunner:
92-
cmd = [hostrunner, getcompiler]
89+
compiler = generate_getbuildinfo._get_compiler(GETCOMPILER)
90+
if use_cc and support.MS_WINDOWS:
91+
self.assertIsNone(compiler)
9392
else:
94-
cmd = [getcompiler]
95-
if use_cc:
93+
self.assertEqual(compiler, MOCK_COMPILER)
94+
95+
if hostrunner and not support.MS_WINDOWS:
96+
cmd = [hostrunner, GETCOMPILER]
97+
else:
98+
cmd = [GETCOMPILER]
99+
if use_cc and not support.MS_WINDOWS:
96100
self.assertEqual(mock_run_command.call_args_list,
97101
[
98102
mock.call(cmd, check=False),

0 commit comments

Comments
 (0)