8000 gh-104683: Add --exclude option to Argument Clinic CLI by erlend-aasland · Pull Request #107770 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-104683: Add --exclude option to Argument Clinic CLI #107770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 8, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Address review
  • Loading branch information
erlend-aasland committed Aug 8, 2023
commit 8d837c04e7a6aa2f2c7e764fd58183d2e70ee6e0
9 changes: 6 additions & 3 deletions Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2221,9 +2221,9 @@ def test_cli_make_exclude(self):
/*[clinic input]
[clinic start generated code]*/
""")
with os_helper.temp_dir() as tmp_dir:
with os_helper.temp_dir(quiet=False) as tmp_dir:
# add some folders, some C files and a Python file
for fn in "file1.c", "file2.c", "file3.c":
for fn in "file1.c", "file2.c", "file3.c", "file4.c":
path = os.path.join(tmp_dir, fn)
with open(path, "w", encoding="utf-8") as f:
f.write(code)
Expand All @@ -2234,13 +2234,16 @@ def test_cli_make_exclude(self):
"-v", "--make", "--srcdir", tmp_dir,
"--exclude", os.path.join(tmp_dir, "file2.c"),
# The added ./ should be normalised away.
"--exclude", os.path.join("./", tmp_dir, "file3.c"),
"--exclude", os.path.join(tmp_dir, "./file3.c"),
# Relative paths should also work.
"--exclude", "file4.c"
)

# expect verbose mode to only mention the C files in tmp_dir
self.assertIn("file1.c", out)
self.assertNotIn("file2.c", out)
self.assertNotIn("file3.c", out)
self.assertNotIn("file4.c", out)

def test_cli_verbose(self):
with os_helper.temp_dir() as tmp_dir:
Expand Down
0