forked from python-control/Slycot
-
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.
add more tests of the exception messages
- Loading branch information
Showing
6 changed files
with
85 additions
and
3 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
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,44 @@ | ||
#!/usr/bin/env python | ||
# | ||
# test_ab.py - generic tests for analysis programs | ||
# repagh <[email protected], May 2020 | ||
|
||
import pytest | ||
from .test_exceptions import assert_docstring_parse | ||
from slycot import analysis | ||
from slycot.exceptions import SlycotArithmeticError, SlycotResultWarning | ||
|
||
|
||
@pytest.mark.parametrize( | ||
'fun, exception_class, erange, checkvars', | ||
((analysis.ab05nd, SlycotArithmeticError, 1, {'p1': 1}), | ||
(analysis.ab07nd, SlycotResultWarning, 2, {'m': 1}), | ||
(analysis.ab09ad, SlycotArithmeticError, 3, {'dico': 'C'}), | ||
(analysis.ab09ad, SlycotArithmeticError, (2,), {'dico': 'D'}), | ||
(analysis.ab09ad, SlycotResultWarning, ((1, 0), ), {'nr': 3, | ||
'Nr': 2}), | ||
(analysis.ab09ax, SlycotArithmeticError, 2, {'dico': 'C'}), | ||
(analysis.ab09ax, SlycotResultWarning, ((1, 0), ), {'nr': 3, | ||
'Nr': 2}), | ||
(analysis.ab09ad, SlycotArithmeticError, 3, {'dico': 'C'}), | ||
(analysis.ab09ad, SlycotResultWarning, ((1, 0), ), {'nr': 3, | ||
'Nr': 2}), | ||
(analysis.ab09md, SlycotArithmeticError, 3, {'alpha': -0.1}), | ||
(analysis.ab09md, SlycotResultWarning, ((1, 0), (2, 0)), {'nr': 3, | ||
'Nr': 2, | ||
'alpha': -0.1}), | ||
(analysis.ab09nd, SlycotArithmeticError, 3, {'alpha': -0.1}), | ||
(analysis.ab09nd, SlycotResultWarning, ((1, 0), (2, 0)), {'nr': 3, | ||
'Nr': 2, | ||
'alpha': -0.1}), | ||
(analysis.ab13bd, SlycotArithmeticError, 6, {'dico': 'C'}), | ||
(analysis.ab13bd, SlycotResultWarning, ((1, 0),), {}), | ||
(analysis.ab13dd, SlycotArithmeticError, 4, {}), | ||
(analysis.ab13ed, SlycotArithmeticError, 1, {}), | ||
(analysis.ab13fd, SlycotArithmeticError, (2,), {}), | ||
(analysis.ab13fd, SlycotResultWarning, (1,), {}))) | ||
def test_ab_docparse(fun, exception_class, erange, checkvars): | ||
assert_docstring_parse(fun.__doc__, exception_class, erange, checkvars) | ||
|
||
|
||
|
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,21 @@ | ||
#!/usr/bin/env python | ||
# | ||
# test_transform.py - generic tests for transform routines | ||
# repagh <[email protected], May 2020 | ||
|
||
import pytest | ||
from .test_exceptions import assert_docstring_parse | ||
from slycot import transform as tf | ||
from slycot.exceptions import SlycotArithmeticError | ||
|
||
|
||
@pytest.mark.parametrize( | ||
'fun, exception_class, erange, checkvars', | ||
((tf.tb03ad, SlycotArithmeticError, 2, {}), | ||
(tf.tb05ad, SlycotArithmeticError, 2, {'n30': 90, | ||
'jomega': 2.0, | ||
'rcond': 1e-12}), | ||
(tf.td04ad, SlycotArithmeticError, (3,), {}), | ||
(tf.tc04ad, SlycotArithmeticError, 1, {'leri': 'L'}))) | ||
def test_transform_docparse(fun, exception_class, erange, checkvars): | ||
assert_docstring_parse(fun.__doc__, exception_class, erange, checkvars) |