MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_parse_makefile

Method test_parse_makefile

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

Source from the content-addressed store, hash-verified

765 self.assertTrue(os.path.isfile(makefile), makefile)
766
767 def test_parse_makefile(self):
768 self.addCleanup(unlink, TESTFN)
769 with open(TESTFN, "w") as makefile:
770 print("var1=a$(VAR2)", file=makefile)
771 print("VAR2=b$(var3)", file=makefile)
772 print("var3=42", file=makefile)
773 print("var4=$/invalid", file=makefile)
774 print("var5=dollar$$5", file=makefile)
775 print("var6=${var3}/lib/python3.5/config-$(VAR2)$(var5)"
776 "-x86_64-linux-gnu", file=makefile)
777 vars = _parse_makefile(TESTFN)
778 self.assertEqual(vars, {
779 'var1': 'ab42',
780 'VAR2': 'b42',
781 'var3': 42,
782 'var4': '$/invalid',
783 'var5': 'dollar$5',
784 'var6': '42/lib/python3.5/config-b42dollar$5-x86_64-linux-gnu',
785 })
786
787
788class DeprecationTests(unittest.TestCase):

Callers

nothing calls this directly

Calls 5

_parse_makefileFunction · 0.90
addCleanupMethod · 0.80
openFunction · 0.50
printFunction · 0.50
assertEqualMethod · 0.45

Tested by

no test coverage detected