Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions slycot/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set(PYSOURCE
test.py
test_ab08n.py
test_ag08bd.py
test_examples.py
test_mb.py
test_mc.py
test_sb10jd.py
Expand Down
29 changes: 29 additions & 0 deletions slycot/tests/test_examples.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""

test_examples.py


"""

from inspect import getmembers, isfunction
import pytest

from slycot import examples

examplefunctions = [fun for (fname, fun) in getmembers(examples)
if isfunction(fun) and "_example" in fname]


@pytest.mark.parametrize('examplefun', examplefunctions)
def test_example(examplefun, capsys, recwarn):
"""
Test the examples.

Test that all the examples work, produce some (unchecked) output but no
exceptions or warnings.
"""
examplefun()
captured = capsys.readouterr()
assert len(captured.out) > 0
assert not captured.err
assert not recwarn