Add additional tests for isinf() function in cmath library · Issue #148868 · python/cpython · GitHub
Skip to content

Add additional tests for isinf() function in cmath library #148868

Description

Feature or enhancement

Proposal:

In Lib/test/test_cmath.py , under the test_isinf() method , many test cases for isinf method are available but edge cases like -inf and inf/inf seems to be missing.

def test_isinf(self):
        self.assertFalse(cmath.isinf(1))
        self.assertFalse(cmath.isinf(1j))
        self.assertFalse(cmath.isinf(NAN))
        self.assertTrue(cmath.isinf(INF))
        self.assertTrue(cmath.isinf(complex(INF, 0)))
        self.assertTrue(cmath.isinf(complex(0, INF)))
        self.assertTrue(cmath.isinf(complex(INF, INF)))
        self.assertTrue(cmath.isinf(complex(NAN, INF)))
        self.assertTrue(cmath.isinf(complex(INF, NAN)))

I have opened a PR adding 2 test cases for -inf and inf/inf

Has this already been discussed elsewhere?

No

Links to previous discussion of this feature:

Linked PRs

Activity

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 dirtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions