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 `PySequence_[InPlace_]Repeat` by sobolevn · Pull Request #99196 · python/cpython

Conversation

@sobolevn

@sobolevn sobolevn commented Nov 7, 2022 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Things I've skipped:

  1. NULL checks for PyLong allocation and NULL check for self. Cannot be reproduced from python
  2. Different values and corner cases for sq_repeat and sq_inplace_repeat, I expect them to be covered in * and *= operators

Coverage view before:
Снимок экрана 2022-11-07 в 14 56 38

Снимок экрана 2022-11-07 в 14 57 07

  • 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
@sobolevn
pythongh-94808: add tests covering PySequence_[InPlace_]Repeat
1597860
@bedevere-bot bedevere-bot mentioned this pull request Nov 7, 2022
Metabug: Improving C-level coverage #94808
Open
@bedevere-bot bedevere-bot added the awaiting review label Nov 7, 2022
@sobolevn sobolevn added the skip news label Nov 7, 2022
@sobolevn
Merge branch 'main' into cover-sequence-repeat
17e5f61
@sobolevn

sobolevn commented Nov 10, 2022

Copy link
Copy Markdown
Member Author

Merge conflicts are resolved, @serhiy-storchaka would you mind taking a look? :)

All reactions

Sorry, something went wrong.

Uh oh!

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

skirpichev
skirpichev approved these changes Jan 15, 2024
View reviewed changes

@skirpichev skirpichev left a comment

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.

Looks good, except for few pep7 nitpicks.

On another hand, I'm not sure if this is a right approach to test abstract interfaces. Another example is PyNumber_* API (#111996). Maybe we should use special, dedicated just for tests types, that have required magic methods, instead of using core types?

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Modules/_testcapimodule.c
sequence_inplace_repeat(PyObject* self, PyObject *args)
{
PyObject *sequence;
Py_ssize_t count;

@skirpichev skirpichev Jan 15, 2024

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.

PEP 7: blank line after local variable declarations;)

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Modules/_testcapimodule.c
sequence_repeat(PyObject* self, PyObject *args)
{
PyObject *sequence;
Py_ssize_t count;

@skirpichev skirpichev Jan 15, 2024

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.

And here.

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added awaiting core review and removed awaiting review labels Jan 15, 2024
@github-actions

github-actions Bot commented Apr 11, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 11, 2026
@ambv

ambv commented Oct 20, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

This PR is superseded by #156966, a newer open pull request for the same issue (gh-94808), and it no longer merges cleanly. Closing to cull the number of open pull requests. Do not reopen this pull request without getting a go-ahead from a triager or core developer.

Reopening. This was prematurely closed because the meta issue was misidentified as a simple issue.

All reactions

Sorry, something went wrong.

Uh oh!

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

@ambv ambv closed this Oct 20, 2026
@ambv ambv reopened this Oct 20, 2026
@ambv
ambv requested a review from markshannon as a code owner October 20, 2026 23:51
@bedevere-app bedevere-app Bot added the type-feature A feature request or enhancement label Oct 20, 2026
@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label Oct 21, 2026
ambv added 2 commits October 21, 2026 20:33
@ambv
Merge branch 'main' into cover-sequence-repeat
1454c3c
Co-authored-by: Muse Code (Meta Muse Spark)

# Conflicts:
#	Lib/test/test_capi/test_misc.py
#	Modules/_testcapimodule.c
@ambv
Deduplicate repeat tests against test_abstract.py coverage
a26a76c
Drop the basic repeat/in-place-repeat tests: test_abstract.py now
covers those paths via _testlimitedcapi (including corner counts,
MemoryError, TypeError and NULL cases). Keep the subtype and error
tests unique to this PR.

Add test_sequence_repeat_numeric_fallback for the previously
untested nb_multiply fallback in PySequence_Repeat.

Assert exact result types with assertIs: comparing against
CustomList(...) only checks contents, and repeat of a builtin
subtype returns the exact builtin type.

Co-authored-by: Muse Code (Meta Muse Spark)
ambv
ambv approved these changes Oct 22, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Oct 22, 2026
@ambv
ambv merged commit ab2c947 into python:main Oct 22, 2026
98 of 102 checks passed

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ambv ambv ambv approved these changes
@skirpichev skirpichev skirpichev approved these changes
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

skip news type-feature A feature request or enhancement

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.

4 participants

@sobolevn @ambv @skirpichev @bedevere-bot
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.