-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathtest_analysis.py
More file actions
44 lines (37 loc) · 2.38 KB
/
Copy pathtest_analysis.py
File metadata and controls
44 lines (37 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#
# test_ab.py - generic tests for analysis programs
# repagh <rene.vanpaassen@gmail.com, May 2020
import pytest
from slycot import analysis
from slycot.exceptions import SlycotArithmeticError, SlycotResultWarning
from .test_exceptions import assert_docstring_parse
@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)