Add More Test Cases for Edge Cases in Number Operations
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- testing-qa
Research direction
Start by reading and running test_numbers.py, which currently covers standard operations and type checks for integers, booleans, floats, and complex numbers. Add focused tests for the listed division, floating-point, NaN/infinity, complex-number, and mixed-operand cases; done means the new tests pass and document the expected behavior.
Written by the indexing model from the issue text.
Description
The current test_numbers.py file provides comprehensive coverage for standard operations and type checks for integers, booleans, floats, and complex numbers. However, it would be beneficial to add more test cases that cover edge cases and unusual scenarios. For example:
- Division by zero and its handling (e.g., 1 / 0 raises ZeroDivisionError).
- Very large and very small floating-point numbers (e.g., underflow/overflow).
- Operations involving NaN and infinity in floats.
- Complex number operations with zero imaginary or real parts.
- Boolean operations with non-boolean operands.
Adding these tests will help ensure robustness and correctness when handling special cases in numerical computations.
- Dominant language
- Python
- Stars
- 18.3k
- Forks
- 3k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
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.
More from trekhleb/learn-python
-
Typo in Variable Name: "weapon.strip()" Should Be "fruit.strip()" in List Comprehensions Example Open
Difficulty 1/5 Under an hour Newbie friendliness 82/100
trekhleb/learn-python#105 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
trekhleb/learn-python#104 · 1 comment ·
-
Learning Python Open
Difficulty 5/5 Over a week Newbie friendliness 10/100
trekhleb/learn-python#108 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
trekhleb/learn-python#107 · 1 comment ·
-
Hack Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
trekhleb/learn-python#102 · 1 comment ·
All issues in trekhleb/learn-python
Similar issues
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
open-webui/open-webui#30750 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 90/100