MCPcopy Index your code
hub / github.com/python/cpython / test_parse_makefile_renamed_vars

Method test_parse_makefile_renamed_vars

Lib/test/test_sysconfig.py:803–822  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

801 })
802
803 def test_parse_makefile_renamed_vars(self):
804 self.addCleanup(unlink, TESTFN)
805 with open(TESTFN, "w") as makefile:
806 print("var1=$(CFLAGS)", file=makefile)
807 print("PY_CFLAGS=-Wall $(CPPFLAGS)", file=makefile)
808 print("PY_LDFLAGS=-lm", file=makefile)
809 print("var2=$(LDFLAGS)", file=makefile)
810 print("var3=$(CPPFLAGS)", file=makefile)
811 with EnvironmentVarGuard() as env:
812 env.clear()
813 vars = _parse_makefile(TESTFN)
814 self.assertEqual(vars, {
815 'var1': '-Wall',
816 'CFLAGS': '-Wall',
817 'PY_CFLAGS': '-Wall',
818 'LDFLAGS': '-lm',
819 'PY_LDFLAGS': '-lm',
820 'var2': '-lm',
821 'var3': '',
822 })
823
824 def test_parse_makefile_keep_unresolved(self):
825 self.addCleanup(unlink, TESTFN)

Callers

nothing calls this directly

Calls 6

EnvironmentVarGuardClass · 0.90
_parse_makefileFunction · 0.90
addCleanupMethod · 0.80
openFunction · 0.50
clearMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected