-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from honno/creation-refactor
Refactor assertions in `test_creation.py`
- Loading branch information
Showing
8 changed files
with
678 additions
and
365 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,9 +1,26 @@ | ||
import pytest | ||
|
||
from ..test_signatures import extension_module | ||
from ..test_creation_functions import frange | ||
|
||
|
||
def test_extension_module_is_extension(): | ||
assert extension_module('linalg') | ||
assert extension_module("linalg") | ||
|
||
|
||
def test_extension_func_is_not_extension(): | ||
assert not extension_module('linalg.cross') | ||
assert not extension_module("linalg.cross") | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"r, size, elements", | ||
[ | ||
(frange(0, 1, 1), 1, [0]), | ||
(frange(1, 0, -1), 1, [1]), | ||
(frange(0, 1, -1), 0, []), | ||
(frange(0, 1, 2), 1, [0]), | ||
], | ||
) | ||
def test_frange(r, size, elements): | ||
assert len(r) == size | ||
assert list(r) == elements |
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
Oops, something went wrong.