-
-
Notifications
You must be signed in to change notification settings - Fork 46.8k
some pytest on math folder #1405
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
Conversation
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.
Nice initiative! Thanks. We need to figure out why pytest is not finding these tests.
https://travis-ci.com/TheAlgorithms/Python/builds/132684336#L416
maths/3n+1.py
Outdated
@@ -32,6 +32,14 @@ def main(): | |||
) | |||
) | |||
|
|||
def testn31(): |
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.
test_n31()
please. Also, please remove blank lines 37 and 39.
maths/abs.py
Outdated
@@ -18,5 +18,13 @@ def main(): | |||
print(abs_val(-34)) # = 34 | |||
|
|||
|
|||
def testAbs(): |
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.
test_abs_val()
please. Also, please remove blank lines 23 and 25.
maths/average_mean.py
Outdated
@@ -12,5 +12,13 @@ def main(): | |||
print(average([2, 4, 6, 8, 20, 50, 70])) | |||
|
|||
|
|||
def testAverage(): |
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.
test_average()
please. Also, please remove blank lines 17 and 19.
maths/average_mean.py
Outdated
if __name__ == "__main__": | ||
main() | ||
testAverage() |
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.
Leave just one blank line at the end of Python files.
|
@cozek We need a pytest expert to help us understand why our non-doctest tests are not being discovered. https://docs.pytest.org/en/latest/goodpractices.html#test-discovery |
Also format the code with psf/black as discussed in CONTRIBUTING.md
* some pytest on math folder * Run the test function via a doctest Also format the code with psf/black as discussed in CONTRIBUTING.md * Update abs.py * Update average_mean.py
Hera are some pytest to simple math algorithms.