Skip to content

Move old C API tests for floats to Lib/test/test_capi/ #111765

Description

@skirpichev

After #111624, we have C API tests for PyFloat_* both in Lib/test/test_float.py (pack/unpack tests) and Lib/test/test_capi/test_float.py. I think we should move remaining tests to Lib/test/test_capi/.

Linked PRs

Activity

  1. added a commit that references this issue on Nov 6, 2023
  2. added a commit that references this issue on Nov 7, 2023
  3. added a commit that references this issue on Nov 7, 2023
  4. added a commit that references this issue on Nov 7, 2023
  5. added a commit that references this issue on Nov 8, 2023
  6. skirpichev commented on Nov 9, 2023

    @skirpichev
    MemberAuthor

    @serhiy-storchaka, I think this could be closed. The test_float.py still imports _testcapi:

    @support.requires_IEEE_754
    @unittest.skipIf(_testcapi is None, 'needs _testcapi')
    def test_serialized_float_rounding(self):
    FLT_MAX = _testcapi.FLT_MAX
    self.assertEqual(struct.pack("<f", 3.40282356e38), struct.pack("<f", FLT_MAX))
    self.assertEqual(struct.pack("<f", -3.40282356e38), struct.pack("<f", -FLT_MAX))

    but this is rather a bug in sys.float_info.

  7. added a commit that references this issue on Feb 11, 2024
  8. added a commit that references this issue on Sep 2, 2024
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

    testsTests in the Lib/test dirtopic-C-APItype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions