-
-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
assert 0 == abs_val(0) | ||
|
||
assert 34 == abs_val(34) | ||
|
||
assert 100000000000 == abs_val(-100000000000) | ||
|
||
if __name__ == "__main__": | ||
main() | ||
testAbs() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
assert 12.0 == average([3, 6, 9, 12, 15, 18, 21]) | ||
|
||
assert 20 == average([5, 10, 15, 20, 25, 30, 35]) | ||
|
||
assert 4.5 == average([1, 2, 3, 4, 5, 6, 7, 8]) | ||
|
||
if __name__ == "__main__": | ||
main() | ||
testAverage() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leave just one blank line at the end of Python files. |
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.