Skip to content

Add more tests for formatting floats and fractions #109546

Description

@serhiy-storchaka

File "formatfloat_testcases.txt" contains test cases for testing printf-like formatting of floats. The same data can be used for testing new-style formatting of floats (they give the same result) and float-style formatting of Fraction (added in 3.12).

cc @mdickinson

Linked PRs

Activity

  1. added
    testsTests in the Lib/test dir
    3.12only security fixes
    3.13only security fixes
    on Sep 18, 2023
  2. added 2 commits that reference this issue on Sep 18, 2023
  3. added a commit that references this issue on Sep 19, 2023
  4. serhiy-storchaka commented on Sep 19, 2023

    @serhiy-storchaka
    MemberAuthor

    I tried also to use this file in test_decimal, but decimals produce very different output.

    I am not sure about test_complex. On one hand, complex formatting uses the same PyOS_double_to_string() as float formatting. On other hand, there is a code between __format__() and PyOS_double_to_string() which can affect interpretation of the format string.

  5. vstinner commented on Sep 19, 2023

    @vstinner
    Member

    It's already great to use it in test_fractions! And that you added more tests in test_float.

  6. added 2 commits that reference this issue on Sep 21, 2023
  7. added a commit that references this issue on Sep 28, 2023
  8. added a commit that references this issue on Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13only security fixestestsTests in the Lib/test dir

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions