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-94808: improve coverage of numbers formatting #99472

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Nov 14, 2022

There are two major changes:

  1. PyNumber_Check in mainformatlong is now covered with complex numbers
  2. I've covered this line that were responsible for re-raising exceptions:

Снимок экрана 2022-11-14 в 15 38 23

I can add lots of other cases in other PRs, including:

  • subclassing of primitives
  • returning subclasses from __int__, __index__, etc (some of which is deprecated)
  • more values and more % formatters

But, this PR is minimal to just increase the phisycal coveraged.

Lib/test/test_unicode.py Outdated Show resolved Hide resolved
Lib/test/test_unicode.py Outdated Show resolved Hide resolved
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Copy link
Contributor

@hauntsaninja hauntsaninja left a comment

Looks good, had one suggestion to use assertRaisesRegex for "%c" case as well

Lib/test/test_unicode.py Outdated Show resolved Hide resolved
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
@sobolevn
Copy link
Member Author

sobolevn commented Dec 23, 2022

@hauntsaninja congrats on becoming CPython core dev! You totally deserve it, I was not able to vote, but you have all the support from my side 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting merge skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants