Skip to content
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

gh-106368: Increase Argument Clinic CLI test coverage #107156

Merged
merged 11 commits into from
Jul 24, 2023

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Jul 23, 2023

Instead of hacking into the Clinic class, use the Argument Clinic tool
to run the ClinicWholeFileTest ClinicExternalTest test suite.

TODO:

  • Remove tmp stuff from test_external, use -o to redirect the output, and simply compare the redirected output with clinic.test.c
  • A new test that verifies that the file is not touched if no changes are made (currently a part of test_external)
  • A test that verifies that an incorrect output checksum (and the generated output) is regenerated if -f is given
  • Test verbose mode

Instead of hacking into the Clinic class, use the Argument Clinic tool
to run the ClinicWholeFileTest test suite.
@bedevere-bot bedevere-bot added the tests Tests in the Lib/test dir label Jul 23, 2023
test_external: run clinic on clinic.test.c

test_no_change: check that dest is left unchanged if content does not change
@erlend-aasland
Copy link
Contributor Author

FWIW; this messes up test coverage locally; that's solvable (IIRC), though.

@erlend-aasland
Copy link
Contributor Author

The coveragerc file that's included in the sources disables coverage for if __name__ == "__main__", which is unfortunate; we should change that.

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better error messages :)

Lib/test/test_clinic.py Outdated Show resolved Hide resolved
Lib/test/test_clinic.py Outdated Show resolved Hide resolved
erlend-aasland and others added 2 commits July 24, 2023 10:12
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@erlend-aasland
Copy link
Contributor Author

Thanks for the review, Nikita!

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! 👍

@erlend-aasland erlend-aasland merged commit 83a2837 into python:main Jul 24, 2023
15 checks passed
@erlend-aasland erlend-aasland deleted the clinic/coverage-cli branch July 24, 2023 18:49
@erlend-aasland erlend-aasland added the needs backport to 3.11 only security fixes label Jul 24, 2023
@erlend-aasland erlend-aasland added the needs backport to 3.12 bug and security fixes label Jul 24, 2023
@miss-islington
Copy link
Contributor

Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 24, 2023
…-107156)

Instead of hacking into the Clinic class, use the Argument Clinic tool
to run the ClinicExternalTest test suite.

(cherry picked from commit 83a2837)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@bedevere-bot
Copy link

GH-107189 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 bug and security fixes label Jul 24, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 24, 2023
…-107156)

Instead of hacking into the Clinic class, use the Argument Clinic tool
to run the ClinicExternalTest test suite.

(cherry picked from commit 83a2837)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@bedevere-bot
Copy link

GH-107190 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jul 24, 2023
erlend-aasland added a commit that referenced this pull request Jul 24, 2023
…) (#107189)

Instead of hacking into the Clinic class, use the Argument Clinic tool
to run the ClinicExternalTest test suite.

(cherry picked from commit 83a2837)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
erlend-aasland added a commit that referenced this pull request Jul 26, 2023
…) (#107190)

Instead of hacking into the Clinic class, use the Argument Clinic tool
to run the ClinicExternalTest test suite.

(cherry picked from commit 83a2837)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
erlend-aasland added a commit to erlend-aasland/cpython that referenced this pull request Jul 26, 2023
…ythonGH-107156) (python#107190)

Instead of hacking into the Clinic class, use the Argument Clinic tool
to run the ClinicExternalTest test suite.

(cherry picked from commit 83a2837)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
jtcave pushed a commit to jtcave/cpython that referenced this pull request Jul 27, 2023
…07156)

Instead of hacking into the Clinic class, use the Argument Clinic tool
to run the ClinicExternalTest test suite.

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants