-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve primelib.py test coverage #9943 #10251
Conversation
for more information, see https://pre-commit.ci
maths/primelib.py
Outdated
(1,2) | ||
>>> simplify_fraction(10,-1) | ||
Traceback (most recent call last): | ||
... | ||
AssertionError: The arguments must been from type int and 'denominator' != 0" | ||
>>> simplify_fraction("test","test") | ||
Traceback (most recent call last): | ||
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doctests are very literal.
(1,2) | |
>>> simplify_fraction(10,-1) | |
Traceback (most recent call last): | |
... | |
AssertionError: The arguments must been from type int and 'denominator' != 0" | |
>>> simplify_fraction("test","test") | |
Traceback (most recent call last): | |
... | |
(1, 2) | |
>>> simplify_fraction(10,-1) | |
Traceback (most recent call last): | |
... | |
AssertionError: The arguments must been from type int and 'denominator' != 0" | |
>>> simplify_fraction("test","test") | |
Traceback (most recent call last): | |
... |
There are git conflicts. This means that someone else has modified this file. |
is my firts time doing a pull request now what I should do ? thanks |
OK. I merged the two changes together so we have two new tests plus your tests. |
Nice, thanks for the help |
Can you run If there is too much output, remove the
|
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thanks for doing this.
If you wanted to create a follow-up pull request to add type hints
to function signatures like we did on line 794, that would be supercool!
…0251) * Update the doctest of primelib.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Correct errors for the doctest of primelib.py * last error for the doctest of primelib.py * last error for the doctest of primelib.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
Describe your change:
Improve the doctest in the primelib.py file.
Checklist: