Increase test coverage for math.py fabs() function
Open
Nobody has claimed this yet.
tests
type-feature
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
In Lib/test/test_math.py, the testFabs() method tests integers but not infinity (especially negative infinity).
def testFabs(self):
self.assertRaises(TypeError, math.fabs)
self.ftest('fabs(-1)', math.fabs(-1), 1)
self.ftest('fabs(0)', math.fabs(0), 0)
self.ftest('fabs(1)', math.fabs(1), 1)
I have submitted a PR that increases test coverage for fabs().
Linked PRs
- gh-149060
- gh-149061
- gh-150940
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open Lib/test/test_math.py and inspect testFabs() and the existing ftest helper. Compare the linked PRs for the intended infinity cases; done means the fabs() tests cover the reported missing behavior and pass in the math test suite.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 20/100