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

Method test_external

Lib/test/test_clinic.py:2971–2985  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2969 return out, err
2970
2971 def test_external(self):
2972 CLINIC_TEST = 'clinic.test.c'
2973 source = support.findfile(CLINIC_TEST)
2974 with open(source, encoding='utf-8') as f:
2975 orig_contents = f.read()
2976
2977 # Run clinic CLI and verify that it does not complain.
2978 self.addCleanup(unlink, TESTFN)
2979 out = self.expect_success("-f", "-o", TESTFN, source)
2980 self.assertEqual(out, "")
2981
2982 with open(TESTFN, encoding='utf-8') as f:
2983 new_contents = f.read()
2984
2985 self.assertEqual(new_contents, orig_contents)
2986
2987 def test_no_change(self):
2988 # bpo-42398: Test that the destination file is left unchanged if the

Callers

nothing calls this directly

Calls 5

expect_successMethod · 0.95
addCleanupMethod · 0.80
openFunction · 0.50
readMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected