GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-94808: add tests covering `PyFunction_GetKwDefaults` and `PyFunction_SetKwDefaults` by sobolevn · Pull Request #98809 · python/cpython

Conversation

@sobolevn

@sobolevn sobolevn commented Oct 28, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There are also several changes to PyFunction_[G|S]etDefaults tests:

  • I've added all types of arguments to function: including pos-only args
  • I've fixed one copy-paste error
  • I've added more corner cases to the test

Refs: #98449

  • Issue: Metabug: Improving C-level coverage #94808

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added the awaiting review label Oct 28, 2022
@sobolevn
pythongh-94808: Cover PyFunction_GetKwDefaults and `PyFunction_SetK…
a200c39
…wDefaults`
@sobolevn
sobolevn force-pushed the cover-pyfunction-get-set-kw-defaults branch from c85132f to a200c39 Compare October 28, 2022 12:31
@sobolevn sobolevn added tests Tests in the Lib/test dir skip news labels Oct 28, 2022
@sobolevn
sobolevn requested a review from iritkatriel November 5, 2022 12:22
@iritkatriel iritkatriel self-assigned this Nov 5, 2022
iritkatriel
iritkatriel reviewed Nov 5, 2022
View reviewed changes
Comment thread Lib/test/test_capi.py
@@ -963,6 +977,8 @@ def some(pos_only='p', zero=0, optional=None):

with self.assertRaises(SystemError):
_testcapi.function_set_defaults(some, 1) # not tuple or None

@iritkatriel iritkatriel Nov 5, 2022

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

It would be good to check here that a failed set in fact did not change the defaults.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@iritkatriel iritkatriel Nov 5, 2022

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Ah I see this is checked after the next failed set. But better to check every time.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sobolevn
Address review
4018edd
@bedevere-bot bedevere-bot mentioned this pull request Nov 5, 2022
Metabug: Improving C-level coverage #94808
Open
iritkatriel
iritkatriel approved these changes Nov 5, 2022
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Nov 5, 2022
@iritkatriel iritkatriel added needs backport to 3.10 needs backport to 3.11 only security fixes labels Nov 5, 2022
@iritkatriel iritkatriel changed the title gh-94808: Cover PyFunction_GetKwDefaults and PyFunction_SetKwDefaults gh-94808: add tests covering PyFunction_GetKwDefaults and PyFunction_SetKwDefaults Nov 5, 2022
@iritkatriel
Merge branch 'main' into cover-pyfunction-get-set-kw-defaults
dccf1fa
@iritkatriel iritkatriel removed the needs backport to 3.10 label Nov 5, 2022
@iritkatriel
iritkatriel merged commit 317acb8 into python:main Nov 5, 2022
@miss-islington

miss-islington commented Nov 5, 2022

Copy link
Copy Markdown
Contributor

Thanks @sobolevn for the PR, and @iritkatriel for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting merge label Nov 5, 2022
@miss-islington

miss-islington commented Nov 5, 2022

Copy link
Copy Markdown
Contributor

Sorry, @sobolevn and @iritkatriel, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 317acb80387674db8c94f48bb9823ae516d05f5c 3.11

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ZeroIntensity ZeroIntensity removed the needs backport to 3.11 only security fixes label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@iritkatriel iritkatriel iritkatriel approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@iritkatriel iritkatriel

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@sobolevn @miss-islington @iritkatriel @bedevere-bot @ZeroIntensity
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.