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-111495: Add tests for PyNumber C API #111996

Merged
merged 38 commits into from
Aug 26, 2024
Merged

Conversation

skirpichev
Copy link
Member

@skirpichev skirpichev commented Nov 12, 2023

@bedevere-app bedevere-app bot mentioned this pull request Nov 12, 2023
10 tasks
@skirpichev

This comment was marked as resolved.

Copy link
Member

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

Lib/test/test_capi/test_number.py Outdated Show resolved Hide resolved
Copy link
Member

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

Modules/_testcapi/numbers.c Show resolved Hide resolved
Lib/test/test_capi/test_number.py Outdated Show resolved Hide resolved
Lib/test/test_capi/test_number.py Outdated Show resolved Hide resolved
@skirpichev
Copy link
Member Author

skirpichev commented Nov 15, 2023

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:

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)

@skirpichev skirpichev marked this pull request as ready for review November 15, 2023 13:28
Lib/test/test_capi/test_number.py Show resolved Hide resolved
Lib/test/test_capi/test_number.py Outdated Show resolved Hide resolved
Lib/test/test_capi/test_number.py Outdated Show resolved Hide resolved
Lib/test/test_capi/test_number.py Outdated Show resolved Hide resolved
Lib/test/test_capi/test_number.py Show resolved Hide resolved
Lib/test/test_capi/test_number.py Show resolved Hide resolved
Lib/test/test_capi/test_number.py Outdated Show resolved Hide resolved
Lib/test/test_capi/test_number.py Show resolved Hide resolved
# Test PyNumber_Negative()
negative = _testcapi.number_negative

self.assertEqual(negative(42), -42)
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

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.

Lib/test/test_capi/test_number.py Outdated Show resolved Hide resolved
* 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
Copy link

⚠️⚠️⚠️ 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'"

@bedevere-bot
Copy link

⚠️⚠️⚠️ 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'"

@bedevere-bot
Copy link

⚠️⚠️⚠️ 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'"

@bedevere-bot
Copy link

⚠️⚠️⚠️ 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'"

@bedevere-bot
Copy link

⚠️⚠️⚠️ 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'"

@bedevere-bot
Copy link

⚠️⚠️⚠️ 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'"

@bedevere-bot
Copy link

⚠️⚠️⚠️ 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'"

@bedevere-bot
Copy link

⚠️⚠️⚠️ 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'"

@bedevere-bot
Copy link

⚠️⚠️⚠️ 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'"

@bedevere-bot
Copy link

⚠️⚠️⚠️ 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'"

@bedevere-bot
Copy link

⚠️⚠️⚠️ 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'"

@bedevere-bot
Copy link

⚠️⚠️⚠️ 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'"

@bedevere-bot
Copy link

⚠️⚠️⚠️ 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'"

@bedevere-bot
Copy link

⚠️⚠️⚠️ 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'"

@bedevere-bot
Copy link

⚠️⚠️⚠️ 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'"

@skirpichev
Copy link
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?

@serhiy-storchaka serhiy-storchaka added needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Aug 27, 2024
@miss-islington-app
Copy link

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

@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 27, 2024
(cherry picked from commit 2f20f5a)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
@miss-islington-app
Copy link

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

@bedevere-app
Copy link

bedevere-app bot commented Aug 27, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Aug 27, 2024
skirpichev added a commit to skirpichev/cpython that referenced this pull request Aug 27, 2024
(cherry picked from commit 2f20f5a)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Aug 27, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Aug 27, 2024
Yhg1s pushed a commit that referenced this pull request Sep 2, 2024
gh-111495: Add tests for PyNumber C API (GH-111996)
(cherry picked from commit 2f20f5a)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
vstinner pushed a commit that referenced this pull request Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants