-
Notifications
You must be signed in to change notification settings - Fork 81
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
c98ad34
commit 930a182
Showing
10 changed files
with
43 additions
and
29 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,6 +1,7 @@ | ||
include ../make.meson.inc | ||
|
||
NAME := pywrapper | ||
WRAPFLAGS += --type-check --kind-map kind.map | ||
|
||
test: build | ||
$(PYTHON) test.py |
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 |
---|---|---|
|
@@ -3,4 +3,4 @@ include ../make.meson.inc | |
NAME := pywrapper | ||
|
||
test: build | ||
$(PYTHON) tests.py | ||
$(PYTHON) test.py |
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,6 +1,9 @@ | ||
include ../make.meson.inc | ||
|
||
NAME := pywrapper | ||
NAME := pywrapper_no_sign | ||
|
||
test: build | ||
$(PYTHON) tests.py | ||
echo "TODO: Fix meson build for tests without signatures" | ||
# $(PYTHON) tests_no_sign.py | ||
echo "TODO: Add tests_sign.py once meson build support signatures" | ||
# $(PYTHON) tests_sign.py |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import unittest | ||
import numpy as np | ||
from packaging import version | ||
|
||
import _pywrapper_sign | ||
|
||
class TestWithSignature(unittest.TestCase): | ||
|
||
@unittest.skipIf(version.parse(np.version.version) < version.parse("1.24.0") , "f2py bug solved https://github.com/numpy/numpy/issues/24706") | ||
def test_string_in_array(self): | ||
in_array = np.array(['one', 'two'], dtype='S3') | ||
output = _pywrapper_sign.string_in_array(in_array) | ||
self.assertEqual(output, 0) | ||
|
||
@unittest.skipIf(version.parse(np.version.version) < version.parse("1.24.0") , "f2py bug solved https://github.com/numpy/numpy/issues/24706") | ||
def test_string_in_array_optional_present(self): | ||
in_array = np.array(['one', 'two'], dtype='S3') | ||
output = _pywrapper_sign.string_in_array_optional(in_array) | ||
self.assertEqual(output, 0) | ||
|
||
def test_string_in_array_optional_not_present(self): | ||
with self.assertRaises((SystemError, ValueError)): | ||
_ = _pywrapper_sign.string_in_array_optional() | ||
|
||
|
||
if __name__ == '__main__': | ||
|
||
unittest.main() |
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,7 +1,7 @@ | ||
include ../make.meson.inc | ||
|
||
NAME := pywrapper | ||
WRAPFLAGS += --type-check | ||
WRAPFLAGS += --type-check --kind-map kind.map | ||
|
||
test: build | ||
$(PYTHON) type_check_test.py |