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

Method test_cli_make_exclude

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

Source from the content-addressed store, hash-verified

3086 self.assertNotIn(path, out)
3087
3088 def test_cli_make_exclude(self):
3089 code = dedent("""
3090 /*[clinic input]
3091 [clinic start generated code]*/
3092 """)
3093 with os_helper.temp_dir(quiet=False) as tmp_dir:
3094 # add some folders, some C files and a Python file
3095 for fn in "file1.c", "file2.c", "file3.c", "file4.c":
3096 path = os.path.join(tmp_dir, fn)
3097 with open(path, "w", encoding="utf-8") as f:
3098 f.write(code)
3099
3100 # Run clinic in verbose mode with --make on tmpdir.
3101 # Exclude file2.c and file3.c.
3102 out = self.expect_success(
3103 "-v", "--make", "--srcdir", tmp_dir,
3104 "--exclude", os.path.join(tmp_dir, "file2.c"),
3105 # The added ./ should be normalised away.
3106 "--exclude", os.path.join(tmp_dir, "./file3.c"),
3107 # Relative paths should also work.
3108 "--exclude", "file4.c"
3109 )
3110
3111 # expect verbose mode to only mention the C files in tmp_dir
3112 self.assertIn("file1.c", out)
3113 self.assertNotIn("file2.c", out)
3114 self.assertNotIn("file3.c", out)
3115 self.assertNotIn("file4.c", out)
3116
3117 def test_cli_verbose(self):
3118 with os_helper.temp_dir() as tmp_dir:

Callers

nothing calls this directly

Calls 8

expect_successMethod · 0.95
dedentFunction · 0.90
temp_dirMethod · 0.80
assertInMethod · 0.80
assertNotInMethod · 0.80
openFunction · 0.50
joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected