Skip to content

Commit

Permalink
fixed test bug
Browse files Browse the repository at this point in the history
solved by setup and teardown to set the
Numeric.trySVD option to its default.
  • Loading branch information
PetePupalaikis committed Nov 15, 2018
1 parent 183683c commit fc1f425
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Test/TestSignalIntegrity/TestCommonElements.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ def __init__(self, methodName='runTest'):
unittest.TestCase.__init__(self,methodName)
def id(self):
return '.'.join(unittest.TestCase.id(self).split('.')[-3:])
def setUp(self):
si.sd.Numeric.trySVD=True
unittest.TestCase.setUp(self)
def tearDown(self):
si.sd.Numeric.trySVD=True
unittest.TestCase.tearDown(self)
def testDeviceShuntFourPort(self):
sdp=si.p.SystemDescriptionParser()
sdp.AddLines(['device D 2','port 1 D 1 2 D 2 3 D 1 4 D 2'])
Expand Down
7 changes: 7 additions & 0 deletions Test/TestSignalIntegrity/TestExceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
class TestExceptions(unittest.TestCase,si.test.SParameterCompareHelper):
def __init__(self, methodName='runTest'):
unittest.TestCase.__init__(self,methodName)
def setUp(self):
si.sd.Numeric.trySVD=True
unittest.TestCase.setUp(self)
def tearDown(self):
si.sd.Numeric.trySVD=True
unittest.TestCase.tearDown(self)
def testSystemDescriptionCheckConnections(self):
sdp=si.p.SystemDescriptionParser()
sdp.AddLines(['device DV 4','device ZI 2','device ZO 2',
Expand Down Expand Up @@ -101,6 +107,7 @@ def testSimulatorNumericalError(self):
si.sd.Numeric.trySVD=False
with self.assertRaises(si.SignalIntegrityException) as cm:
sn.TransferMatrix()
si.sd.Numeric.trySVD=True
self.assertEqual(cm.exception.parameter,'Simulator')
@unittest.expectedFailure
def testSimulatorNumericalErrorNonsenseResult(self):
Expand Down
4 changes: 4 additions & 0 deletions Test/TestSignalIntegrity/TestSimulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ def __init__(self, methodName='runTest'):
def setUp(self):
os.chdir(os.path.dirname(os.path.realpath(__file__)))
si.td.wf.Waveform.adaptionStrategy='SinX'
si.sd.Numeric.trySVD=True
unittest.TestCase.setUp(self)
def tearDown(self):
si.td.wf.Waveform.adaptionStrategy='SinX'
si.sd.Numeric.trySVD=True
unittest.TestCase.tearDown(self)
def testSymbolicSimulatorExample1Old(self):
sd=si.sd.SystemDescription()
sd.AddDevice('S',2)
Expand Down
6 changes: 6 additions & 0 deletions Test/TestSignalIntegrity/TestTeeProblem.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ def __init__(self, methodName='runTest'):
unittest.TestCase.__init__(self,methodName)
def id(self):
return 'TestTeeProblem.'+'.'.join(unittest.TestCase.id(self).split('.')[-2:])
def setUp(self):
si.sd.Numeric.trySVD=True
unittest.TestCase.setUp(self)
def tearDown(self):
si.sd.Numeric.trySVD=True
unittest.TestCase.tearDown(self)
def testTeeSystemDescription(self):
sdp=si.p.SystemDescriptionParser()
sdp.AddLines(['device D 2 thru','port 1 D 1 2 D 1 3 D 2','connect D 2 D 2'])
Expand Down

0 comments on commit fc1f425

Please sign in to comment.