-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename sum to calc_sum to avoid name conflicts with built-in sum
- Loading branch information
Showing
3 changed files
with
11 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
from python_training_project.calculate import sum | ||
from python_training_project.calculate import calc_sum | ||
|
||
|
||
def test_sum(): | ||
assert sum(1, 1) == 2 | ||
assert sum(2, 1) == 3 | ||
assert sum(1, 2) == 3 | ||
def test_calc_sum(): | ||
assert calc_sum(1, 1) == 2 | ||
assert calc_sum(2, 1) == 3 | ||
assert calc_sum(1, 2) == 3 | ||
|
||
|
||
def test_sum_negative(): | ||
assert sum(1, -1) == 0 | ||
assert sum(-1, 1) == 0 | ||
assert sum(-1, -1) == -2 | ||
assert calc_sum(1, -1) == 0 | ||
assert calc_sum(-1, 1) == 0 | ||
assert calc_sum(-1, -1) == -2 |