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-111495: Add tests for PyNumber C API by skirpichev · Pull Request #111996 · python/cpython

Conversation

@skirpichev

@skirpichev skirpichev commented Nov 12, 2023 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • Issue: Add more C API tests #111495

Sorry, something went wrong.

Uh oh!

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

All reactions
skirpichev added 3 commits November 12, 2023 05:56
@skirpichev
pythongh-111495: Add tests for PyNumber C API
cbca658
@skirpichev
Remove inaccessible code (PyLong_AsSsize_t raises OverflowError)
0d95d57
@skirpichev
Drop checks for broken float subclasses (like for PyNumber_Long in 31…
7b8adb4
…a6554)
@bedevere-app bedevere-app Bot mentioned this pull request Nov 12, 2023
Add more C API tests #111495
Closed
10 tasks done
@skirpichev

This comment was marked as resolved.

Sign in to view
@Eclips4 Eclips4 added the skip news label Nov 12, 2023
serhiy-storchaka
serhiy-storchaka reviewed Nov 12, 2023
View reviewed changes

@serhiy-storchaka serhiy-storchaka 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.

The wrapper code is similar for most 1- and 2-argumet functions. What do you think about using macros to generate them? It would be easier to review and extend.

Sorry, something went wrong.

Uh oh!

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

skirpichev reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Lib/test/test_capi/test_number.py Resolved

Uh oh!

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

skirpichev added 4 commits November 13, 2023 10:56
@skirpichev
+ tests with sets for intersection/union/etc
4665f25
@skirpichev
Use macroses
9e14905
@skirpichev
Merge branch 'main' into capi-number-tests
c0f4051
@skirpichev
Merge branch 'main' into capi-number-tests
3a7a4c4
@skirpichev
skirpichev force-pushed the capi-number-tests branch from dd182df to daf4b6f Compare November 15, 2023 06:38
skirpichev added 2 commits November 15, 2023 09:40
@skirpichev
Ternary ops (currently only pow/ipow) don't use __r*__ dunders
788e9c2
@skirpichev
More tests
8cf4429
@skirpichev
skirpichev force-pushed the capi-number-tests branch from daf4b6f to 8cf4429 Compare November 15, 2023 06:40
@skirpichev
Merge branch 'main' into capi-number-tests
91c68a7
serhiy-storchaka
serhiy-storchaka reviewed Nov 15, 2023
View reviewed changes

@serhiy-storchaka serhiy-storchaka 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.

For now LGTM. But please move changes in abstract.c to a separate PR. This PR should contain tests only.

Also, there is an existing PyNumber test in test_abstract. Please move it to other tests, and the corresponding wrapper too.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Modules/_testcapi/numbers.c Resolved

Uh oh!

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

Comment thread Lib/test/test_capi/test_number.py Resolved

Uh oh!

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

Comment thread Lib/test/test_capi/test_number.py Resolved

Uh oh!

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

skirpichev added 4 commits November 15, 2023 14:22
@skirpichev
More tests
9f6fd15
@skirpichev
Use BINARY_FUNC macro for some remaining ops
9f5b7a1
@skirpichev
Add UNARY_FUNC macro to define unary PyNumber_* functions
2675738
@skirpichev
Fix typo
2bc6bc7
@skirpichev
skirpichev force-pushed the capi-number-tests branch from 15f8a7b to 2bc6bc7 Compare November 15, 2023 11:38
@skirpichev

skirpichev commented Nov 15, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

please move changes in abstract.c to a separate PR

That was the plan. But please could you first take look on these changes? This part seems to be finished and I would know, for example, if this can go in one PR or in several.

For now, almost every line for PyNumber_* C API is covered. Exceptions are like this:

cpython/Objects/abstract.c

Line 1593 in d4f83e1

if (!result || PyLong_CheckExact(result)) {

(result check here will require test code in C)

Also, there is an existing PyNumber test in test_abstract.

Indeed. Should I remove number_check() from the abstract.c or from the number.c instead?

Edit:

  • now everything is covered
  • number_check() removed from abstract.c
  • I'll mark this pr as ready for review, as it's reviewed anyway (but it's apparently lacks a number of tests, esp. for mutable ops)
All reactions

Sorry, something went wrong.

Uh oh!

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

skirpichev added 3 commits November 15, 2023 15:56
@skirpichev
Make last argument optional for PyNumber_Power/InPlacePower
49d673b
@skirpichev
More tests
b2dda89
@skirpichev
Remove number_check() from _testcapi/abstract.c, move tests
b86d2eb
@skirpichev
skirpichev marked this pull request as ready for review November 15, 2023 13:28
@bedevere-app bedevere-app Bot added the awaiting review label Nov 15, 2023
serhiy-storchaka
serhiy-storchaka reviewed Nov 15, 2023
View reviewed changes
Comment thread Lib/test/test_capi/test_number.py Resolved

Uh oh!

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

Comment thread Lib/test/test_capi/test_number.py Resolved

Uh oh!

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

Comment thread Lib/test/test_capi/test_number.py Resolved

Uh oh!

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

Comment thread Lib/test/test_capi/test_number.py Resolved

Uh oh!

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

Comment thread Lib/test/test_capi/test_number.py Resolved

Uh oh!

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

Comment thread Lib/test/test_capi/test_number.py Resolved

Uh oh!

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

Comment thread Lib/test/test_capi/test_number.py Resolved

Uh oh!

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

Comment thread Lib/test/test_capi/test_number.py Resolved

Uh oh!

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

Comment thread Lib/test/test_capi/test_number.py Outdated
# Test PyNumber_Negative()
negative = _testcapi.number_negative

self.assertEqual(negative(42), -42)

@serhiy-storchaka serhiy-storchaka Nov 15, 2023

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.

For all tests currently with integers only, add also tests with floats and mixed.

Sorry, something went wrong.

Uh oh!

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

All reactions

@skirpichev skirpichev Nov 16, 2023

Copy link
Copy Markdown
Member Author

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.

Did this with unary ops, then will extend to other tests as well.

Sorry, something went wrong.

Uh oh!

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

All reactions

@skirpichev skirpichev Nov 18, 2023

Copy link
Copy Markdown
Member Author

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.

In fact, I think the old test layout was a bad idea. In the last commit I'm using just one method to test all four unary functions (PyNumber_Negative and friends).

This should be doable for binary and ternary functions as well, so I'll go that way, probably could do pr ready tomorrow. Special handling will be required for PyNumber_*Add/Multiply, which also utilize tp_as_sequence. Here almost all cases could be tested using built-in types. But not all. Thus, I think some C-coded test type must be used.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/test/test_capi/test_number.py Resolved

Uh oh!

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

@skirpichev
address review:
0fbbba9
* Add test for [1, 2] and PY_SSIZE_T_MAX//2 + 1 (test_multiply)
* test with floats for unary
* test_float/index with strings
* 42 is too large. What about 3? // tobase
* test with float & string // tobase
* complex test for absolute
@bedevere-bot

bedevere-bot commented Aug 26, 2024

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Debian root 3.x has failed when building commit 2f20f5a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/345/builds/8794) and take a look at the build logs.
  4. Check if the failure is related to this commit (2f20f5a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/345/builds/8794

Failed tests:

  • test_capi

Failed subtests:

  • test_rshift_print - test.test_capi.test_number.CAPITest.test_rshift_print

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_capi/test_number.py", line 227, in test_rshift_print
    self.assertIn('Did you mean "print(<message>, '
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  'file=<output_stream>)"?', str(context.exception))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Did you mean "print(<message>, file=<output_stream>)"?' not found in "unsupported operand type(s) for >>: 'builtin_function_or_method' and 'int'"
All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Aug 26, 2024

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot x86-64 MacOS Intel NoGIL 3.x has failed when building commit 2f20f5a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1258/builds/2654) and take a look at the build logs.
  4. Check if the failure is related to this commit (2f20f5a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1258/builds/2654

Failed tests:

  • test_capi

Failed subtests:

  • test_rshift_print - test.test_capi.test_number.CAPITest.test_rshift_print

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "<string>", line 10, in <module>
  File "<frozen importlib._bootstrap>", line 813, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1046, in create_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
ImportError: module _test_module_state_shared does not support loading in subinterpreters
xpected failure


Traceback (most recent call last):
  File "/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/test/test_capi/test_number.py", line 227, in test_rshift_print
    self.assertIn('Did you mean "print(<message>, '
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  'file=<output_stream>)"?', str(context.exception))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Did you mean "print(<message>, file=<output_stream>)"?' not found in "unsupported operand type(s) for >>: 'builtin_function_or_method' and 'int'"
All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Aug 26, 2024

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora Clang 3.x has failed when building commit 2f20f5a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/3/builds/6639) and take a look at the build logs.
  4. Check if the failure is related to this commit (2f20f5a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/3/builds/6639

Failed tests:

  • test_capi

Failed subtests:

  • test_rshift_print - test.test_capi.test_number.CAPITest.test_rshift_print

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/test/test_capi/test_number.py", line 227, in test_rshift_print
    self.assertIn('Did you mean "print(<message>, '
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  'file=<output_stream>)"?', str(context.exception))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Did you mean "print(<message>, file=<output_stream>)"?' not found in "unsupported operand type(s) for >>: 'builtin_function_or_method' and 'int'"
All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Aug 26, 2024

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Windows10 3.x has failed when building commit 2f20f5a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/146/builds/9358) and take a look at the build logs.
  4. Check if the failure is related to this commit (2f20f5a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/146/builds/9358

Failed tests:

  • test_capi

Failed subtests:

  • test_rshift_print - test.test_capi.test_number.CAPITest.test_rshift_print

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_capi\test_number.py", line 227, in test_rshift_print
    self.assertIn('Did you mean "print(<message>, '
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  'file=<output_stream>)"?', str(context.exception))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Did you mean "print(<message>, file=<output_stream>)"?' not found in "unsupported operand type(s) for >>: 'builtin_function_or_method' and 'int'"
All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Aug 26, 2024

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 RHEL8 LTO + PGO 3.x has failed when building commit 2f20f5a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/568/builds/7186) and take a look at the build logs.
  4. Check if the failure is related to this commit (2f20f5a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/568/builds/7186

Failed tests:

  • test_capi

Failed subtests:

  • test_rshift_print - test.test_capi.test_number.CAPITest.test_rshift_print

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-x86_64.lto-pgo/build/Lib/test/test_capi/test_number.py", line 227, in test_rshift_print
    self.assertIn('Did you mean "print(<message>, '
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  'file=<output_stream>)"?', str(context.exception))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Did you mean "print(<message>, file=<output_stream>)"?' not found in "unsupported operand type(s) for >>: 'builtin_function_or_method' and 'int'"
All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Aug 26, 2024

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x RHEL8 LTO 3.x has failed when building commit 2f20f5a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/567/builds/7197) and take a look at the build logs.
  4. Check if the failure is related to this commit (2f20f5a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/567/builds/7197

Failed tests:

  • test_capi

Failed subtests:

  • test_rshift_print - test.test_capi.test_number.CAPITest.test_rshift_print

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel8-z.lto/build/Lib/test/test_capi/test_number.py", line 227, in test_rshift_print
    self.assertIn('Did you mean "print(<message>, '
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  'file=<output_stream>)"?', str(context.exception))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Did you mean "print(<message>, file=<output_stream>)"?' not found in "unsupported operand type(s) for >>: 'builtin_function_or_method' and 'int'"
All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Aug 26, 2024

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora Clang Installed 3.x has failed when building commit 2f20f5a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/531/builds/6470) and take a look at the build logs.
  4. Check if the failure is related to this commit (2f20f5a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/531/builds/6470

Failed tests:

  • test_capi

Failed subtests:

  • test_rshift_print - test.test_capi.test_number.CAPITest.test_rshift_print

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang-installed/build/target/lib/python3.14/test/test_capi/test_number.py", line 227, in test_rshift_print
    self.assertIn('Did you mean "print(<message>, '
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  'file=<output_stream>)"?', str(context.exception))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Did you mean "print(<message>, file=<output_stream>)"?' not found in "unsupported operand type(s) for >>: 'builtin_function_or_method' and 'int'"
All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Aug 26, 2024

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 RHEL8 FIPS Only Blake2 Builtin Hash 3.x has failed when building commit 2f20f5a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/469/builds/8845) and take a look at the build logs.
  4. Check if the failure is related to this commit (2f20f5a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/469/builds/8845

Failed tests:

  • test_capi

Failed subtests:

  • test_rshift_print - test.test_capi.test_number.CAPITest.test_rshift_print

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/test/test_capi/test_number.py", line 227, in test_rshift_print
    self.assertIn('Did you mean "print(<message>, '
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  'file=<output_stream>)"?', str(context.exception))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Did you mean "print(<message>, file=<output_stream>)"?' not found in "unsupported operand type(s) for >>: 'builtin_function_or_method' and 'int'"
All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Aug 26, 2024

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x RHEL9 LTO 3.x has failed when building commit 2f20f5a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1587/builds/177) and take a look at the build logs.
  4. Check if the failure is related to this commit (2f20f5a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1587/builds/177

Failed tests:

  • test_capi

Failed subtests:

  • test_rshift_print - test.test_capi.test_number.CAPITest.test_rshift_print

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z.lto/build/Lib/test/test_capi/test_number.py", line 227, in test_rshift_print
    self.assertIn('Did you mean "print(<message>, '
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  'file=<output_stream>)"?', str(context.exception))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Did you mean "print(<message>, file=<output_stream>)"?' not found in "unsupported operand type(s) for >>: 'builtin_function_or_method' and 'int'"
All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Aug 26, 2024

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Ubuntu Shared 3.x has failed when building commit 2f20f5a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/506/builds/8613) and take a look at the build logs.
  4. Check if the failure is related to this commit (2f20f5a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/506/builds/8613

Failed tests:

  • test_capi

Failed subtests:

  • test_rshift_print - test.test_capi.test_number.CAPITest.test_rshift_print

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_capi/test_number.py", line 227, in test_rshift_print
    self.assertIn('Did you mean "print(<message>, '
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  'file=<output_stream>)"?', str(context.exception))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Did you mean "print(<message>, file=<output_stream>)"?' not found in "unsupported operand type(s) for >>: 'builtin_function_or_method' and 'int'"
All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Aug 26, 2024

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot x86-64 macOS 3.x has failed when building commit 2f20f5a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/366/builds/7532) and take a look at the build logs.
  4. Check if the failure is related to this commit (2f20f5a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/366/builds/7532

Failed tests:

  • test_capi

Failed subtests:

  • test_rshift_print - test.test_capi.test_number.CAPITest.test_rshift_print

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/test/test_capi/test_number.py", line 227, in test_rshift_print
    self.assertIn('Did you mean "print(<message>, '
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  'file=<output_stream>)"?', str(context.exception))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Did you mean "print(<message>, file=<output_stream>)"?' not found in "unsupported operand type(s) for >>: 'builtin_function_or_method' and 'int'"
All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Aug 26, 2024

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM64 Windows 3.x has failed when building commit 2f20f5a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/729/builds/6685) and take a look at the build logs.
  4. Check if the failure is related to this commit (2f20f5a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/729/builds/6685

Failed tests:

  • test_capi

Failed subtests:

  • test_rshift_print - test.test_capi.test_number.CAPITest.test_rshift_print

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "C:\Workspace\buildarea\3.x.linaro-win-arm64\build\Lib\test\test_capi\test_number.py", line 227, in test_rshift_print
    self.assertIn('Did you mean "print(<message>, '
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  'file=<output_stream>)"?', str(context.exception))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Did you mean "print(<message>, file=<output_stream>)"?' not found in "unsupported operand type(s) for >>: 'builtin_function_or_method' and 'int'"
All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Aug 26, 2024

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora LTO + PGO 3.x has failed when building commit 2f20f5a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/545/builds/6412) and take a look at the build logs.
  4. Check if the failure is related to this commit (2f20f5a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/545/builds/6412

Failed tests:

  • test_capi

Failed subtests:

  • test_rshift_print - test.test_capi.test_number.CAPITest.test_rshift_print

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.lto-pgo/build/Lib/test/test_capi/test_number.py", line 227, in test_rshift_print
    self.assertIn('Did you mean "print(<message>, '
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  'file=<output_stream>)"?', str(context.exception))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Did you mean "print(<message>, file=<output_stream>)"?' not found in "unsupported operand type(s) for >>: 'builtin_function_or_method' and 'int'"
All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Aug 26, 2024

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM64 Windows Non-Debug 3.x has failed when building commit 2f20f5a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/730/builds/10142) and take a look at the build logs.
  4. Check if the failure is related to this commit (2f20f5a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/730/builds/10142

Failed tests:

  • test_capi

Failed subtests:

  • test_rshift_print - test.test_capi.test_number.CAPITest.test_rshift_print

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "C:\Workspace\buildarea\3.x.linaro-win-arm64.nondebug\build\Lib\test\test_capi\test_number.py", line 227, in test_rshift_print
    self.assertIn('Did you mean "print(<message>, '
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  'file=<output_stream>)"?', str(context.exception))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Did you mean "print(<message>, file=<output_stream>)"?' not found in "unsupported operand type(s) for >>: 'builtin_function_or_method' and 'int'"
All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Aug 26, 2024

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora LTO 3.x has failed when building commit 2f20f5a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/55/builds/5519) and take a look at the build logs.
  4. Check if the failure is related to this commit (2f20f5a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/55/builds/5519

Failed tests:

  • test_capi

Failed subtests:

  • test_rshift_print - test.test_capi.test_number.CAPITest.test_rshift_print

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.lto/build/Lib/test/test_capi/test_number.py", line 227, in test_rshift_print
    self.assertIn('Did you mean "print(<message>, '
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  'file=<output_stream>)"?', str(context.exception))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Did you mean "print(<message>, file=<output_stream>)"?' not found in "unsupported operand type(s) for >>: 'builtin_function_or_method' and 'int'"
All reactions

Sorry, something went wrong.

Uh oh!

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

@skirpichev

skirpichev commented Aug 27, 2024

Copy link
Copy Markdown
Member Author

Oops, that's a real bug: I wrote PR #123338 to fix the tests.

Yeah, I forgot to sync this pr with the main branch.

@vstinner, probably this also should be backported (as is) for 3.12 and 3.13?

All reactions

Sorry, something went wrong.

Uh oh!

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

@serhiy-storchaka serhiy-storchaka added needs backport to 3.12 only security fixes needs backport to 3.13 only security fixes labels Aug 27, 2024
@miss-islington-app

miss-islington-app Bot commented Aug 27, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington-app

miss-islington-app Bot commented Aug 27, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 27, 2024
@skirpichev @miss-islington
pythongh-111495: Add tests for PyNumber C API (pythonGH-111996)
1144c52
(cherry picked from commit 2f20f5a)

Co-authored-by: Sergey B Kirpichev <[email protected]>
@miss-islington-app

miss-islington-app Bot commented Aug 27, 2024

Copy link
Copy Markdown

Sorry, @skirpichev and @vstinner, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 2f20f5a9bc7dafdb3c2ae723da90eca1727a95f7 3.12
All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app

bedevere-app Bot commented Aug 27, 2024

Copy link
Copy Markdown

GH-123375 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington-app miss-islington-app Bot assigned vstinner Aug 27, 2024
@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Aug 27, 2024
skirpichev added a commit to skirpichev/cpython that referenced this pull request Aug 27, 2024
@skirpichev
[3.12] pythongh-111495: Add tests for PyNumber C API (pythonGH-111996)
713f338
(cherry picked from commit 2f20f5a)

Co-authored-by: Sergey B Kirpichev <[email protected]>
@bedevere-app

bedevere-app Bot commented Aug 27, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Aug 27, 2024
Yhg1s pushed a commit that referenced this pull request Sep 2, 2024
@miss-islington @skirpichev
[3.13] gh-111495: Add tests for PyNumber C API (GH-111996) (#123375)
cbcb9e1
gh-111495: Add tests for PyNumber C API (GH-111996)
(cherry picked from commit 2f20f5a)

Co-authored-by: Sergey B Kirpichev <[email protected]>
vstinner pushed a commit that referenced this pull request Sep 5, 2024
@skirpichev
[3.12] gh-111495: Add tests for PyNumber C API (GH-111996) (#123376)
1d8ab25
(cherry picked from commit 2f20f5a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner approved these changes
@serhiy-storchaka serhiy-storchaka Awaiting requested review from serhiy-storchaka

Uh oh!

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

Assignees

@vstinner vstinner

Labels

skip news

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

@skirpichev @serhiy-storchaka @vstinner @bedevere-bot @Eclips4
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.