Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Lib/test/test_sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
)
from test.support.import_helper import import_module
from test.support.os_helper import (TESTFN, unlink, skip_unless_symlink,
change_cwd)
change_cwd, EnvironmentVarGuard)
from test.support.venv import VirtualEnvironmentMixin

import sysconfig
Expand Down Expand Up @@ -807,7 +807,9 @@ def test_parse_makefile_renamed_vars(self):
print("PY_LDFLAGS=-lm", file=makefile)
print("var2=$(LDFLAGS)", file=makefile)
print("var3=$(CPPFLAGS)", file=makefile)
vars = _parse_makefile(TESTFN)
with EnvironmentVarGuard() as env:
env.clear()
vars = _parse_makefile(TESTFN)
self.assertEqual(vars, {
'var1': '-Wall',
'CFLAGS': '-Wall',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Make ``test_sysconfig.test_parse_makefile_renamed_vars`` less fragile by
clearing the environment variables before parsing the Makefile.
Loading