File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 99"""
1010
1111from __future__ import print_function
12+ import re
1213
1314import numpy as np
1415import pytest
@@ -1437,7 +1438,13 @@ def test_interconnect_unused_input():
14371438 connections = False )
14381439
14391440 #https://docs.pytest.org/en/6.2.x/warnings.html#recwarn
1440- assert not record
1441+ for r in record :
1442+ # strip out matrix warnings
1443+ if re .match (r'.*matrix subclass' , str (r .message )):
1444+ continue
1445+ print (r .message )
1446+ pytest .fail (f'Unexpected warning: { r .message } ' )
1447+
14411448
14421449 # warn if explicity ignored input in fact used
14431450 with pytest .warns (UserWarning , match = r"Input\(s\) specified as ignored is \(are\) used:" ) as record :
@@ -1481,7 +1488,6 @@ def test_interconnect_unused_output():
14811488 h = ct .interconnect ([g ,s ,k ],
14821489 inputs = ['r' ],
14831490 outputs = ['y' ])
1484- print (record .list [0 ])
14851491
14861492
14871493 # no warning if output explicitly ignored
@@ -1501,7 +1507,12 @@ def test_interconnect_unused_output():
15011507 connections = False )
15021508
15031509 #https://docs.pytest.org/en/6.2.x/warnings.html#recwarn
1504- assert not record
1510+ for r in record :
1511+ # strip out matrix warnings
1512+ if re .match (r'.*matrix subclass' , str (r .message )):
1513+ continue
1514+ print (r .message )
1515+ pytest .fail (f'Unexpected warning: { r .message } ' )
15051516
15061517 # warn if explicity ignored output in fact used
15071518 with pytest .warns (UserWarning , match = r"Output\(s\) specified as ignored is \(are\) used:" ):
You can’t perform that action at this time.
0 commit comments