Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-106368: Argument clinic tests: improve failure message when tests inClinicExternalTests fail#107364

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
AlexWaygood merged 2 commits intopython:mainfromAlexWaygood:clinic-test-message
Jul 27, 2023

Conversation

@AlexWaygood
Copy link
Member

@AlexWaygoodAlexWaygood commentedJul 27, 2023
edited by bedevere-bot
Loading

Currently, if I apply this diff toTools/clinic/clinic.py...

--- a/Tools/clinic/clinic.py+++ b/Tools/clinic/clinic.py@@ -4702,6 +4702,7 @@ def state_modulename_name(self, line: str | None) -> None:                 fields = [x.strip() for x in existing.split('.')]                 function_name = fields.pop()                 module, cls = self.clinic._module_and_class(fields)+                1/0                 for existing_function in (cls or module).functions:                     if existing_function.name == function_name:

...then the argument clinic tests fail for me locally (good!), but the failure message is terrible (bad!):

======================================================================FAIL:test_external (test.test_clinic.ClinicExternalTest.test_external)----------------------------------------------------------------------Traceback (most recent call last):  File"C:\Users\alexw\coding\cpython\Lib\test\test_clinic.py", line1410, intest_external    out=self.expect_success("-f","-o",TESTFN, source)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"C:\Users\alexw\coding\cpython\Lib\test\test_clinic.py", line1397, inexpect_successreturnself._do_test(*args)^^^^^^^^^^^^^^^^^^^^  File"C:\Users\alexw\coding\cpython\Lib\test\test_clinic.py", line1389, in_do_testself.fail("".join(proc.stderr))AssertionError----------------------------------------------------------------------

This change makes the error messagemuch more helpful!

======================================================================FAIL:test_external (test.test_clinic.ClinicExternalTest.test_external)----------------------------------------------------------------------Traceback (most recent call last):  File"C:\Users\alexw\coding\cpython\Lib\test\test_clinic.py", line1411, intest_external    out=self.expect_success("-f","-o",TESTFN, source)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"C:\Users\alexw\coding\cpython\Lib\test\test_clinic.py", line1398, inexpect_successreturnself._do_test(*args)^^^^^^^^^^^^^^^^^^^^  File"C:\Users\alexw\coding\cpython\Lib\test\test_clinic.py", line1390, in_do_testself.fail("".join(itertools.chain(proc.stdout, proc.stderr)))AssertionError:Error in file "C:\Users\alexw\coding\cpython\Lib\test\clinic.test.c" on line 117:Exception raised during parsing:Traceback (most recent call last):  File"C:\Users\alexw\coding\cpython\Tools\clinic\clinic.py", line2244, inparse    parser.parse(block)  File"C:\Users\alexw\coding\cpython\Tools\clinic\clinic.py", line4608, inparseself.state(line)  File"C:\Users\alexw\coding\cpython\Tools\clinic\clinic.py", line4666, instate_dsl_startself.next(self.state_modulename_name, line)  File"C:\Users\alexw\coding\cpython\Tools\clinic\clinic.py", line4648, innextself.state(line)  File"C:\Users\alexw\coding\cpython\Tools\clinic\clinic.py", line4705, instate_modulename_name1/0~^~ZeroDivisionError:division by zero----------------------------------------------------------------------

(@erlend-aasland do you see the same thing locally? Am I seeing something different because I'm using a Windows box?)

@bedevere-botbedevere-bot added awaiting core review testsTests in the Lib/test dir labelsJul 27, 2023
@AlexWaygoodAlexWaygood changed the titleArgument clinic tests: improve failure message when tests inClinicExternalTests failgh-106368: Argument clinic tests: improve failure message when tests inClinicExternalTests failJul 27, 2023
Copy link
Contributor

@erlend-aaslanderlend-aasland left a comment

Choose a reason for hiding this comment

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

Thanks! (BTW, I love itertools!)

AlexWaygood reacted with laugh emoji
@miss-islington
Copy link
Contributor

Thanks@AlexWaygood for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-107365 is a backport of this pull request to the3.12 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.12only security fixes labelJul 27, 2023
@bedevere-bot
Copy link

GH-107366 is a backport of this pull request to the3.11 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.11only security fixes labelJul 27, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJul 27, 2023
…tests in `ClinicExternalTests` fail (pythonGH-107364)(cherry picked from commit76c26ea)Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJul 27, 2023
…tests in `ClinicExternalTests` fail (pythonGH-107364)(cherry picked from commit76c26ea)Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@AlexWaygoodAlexWaygood deleted the clinic-test-message branchJuly 27, 2023 23:58
AlexWaygood added a commit that referenced this pull requestJul 28, 2023
… tests in `ClinicExternalTests` fail (GH-107364) (#107366)gh-106368: Argument clinic tests: improve failure message when tests in `ClinicExternalTests` fail (GH-107364)(cherry picked from commit76c26ea)Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
AlexWaygood added a commit that referenced this pull requestJul 28, 2023
… tests in `ClinicExternalTests` fail (GH-107364) (#107365)gh-106368: Argument clinic tests: improve failure message when tests in `ClinicExternalTests` fail (GH-107364)(cherry picked from commit76c26ea)Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@erlend-aaslanderlend-aaslanderlend-aasland approved these changes

Assignees

No one assigned

Labels

skip newstestsTests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@AlexWaygood@miss-islington@bedevere-bot@erlend-aasland

[8]ページ先頭

©2009-2025 Movatter.jp