-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d5bad5
commit aa475b9
Showing
2 changed files
with
12 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import pytest | ||
import numpy as np | ||
import pytest | ||
from numpy.testing import assert_allclose | ||
|
||
from template.sample import add, make_array | ||
|
||
|
||
def test_add(): | ||
assert add(1, 2) == 3 | ||
assert add(1.5, 2.0) == pytest.approx(3.5) | ||
assert add(1, 2) == 3 | ||
assert add(1.5, 2.0) == pytest.approx(3.5) | ||
|
||
|
||
def test_make_array(): | ||
assert_allclose(make_array(3), np.array([3, 3, 3])) | ||
assert_allclose(make_array(3, 4), np.array([3, 3, 3, 3])) | ||
assert_allclose(make_array(3), np.array([3, 3, 3])) | ||
assert_allclose(make_array(3, 4), np.array([3, 3, 3, 3])) |