Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_testsuite(self):
t1 = self.T([2,3])
t2 = self.T([5,6])
m1 = self.M(2,3)
m2 = self.M(5,6)
t = TestSuite([t1,t2])
t.judge([m1,m2])
t = TestSuite([t1,t2],skip_models=[m1],include_models=[m2])
t.judge([m1,m2])
def prep_models_and_tests(self):
from sciunit import TestSuite
t1 = self.T([2,3],name='test1')
t2 = self.T([5,6])
m1 = self.M(2,3)
m2 = self.M(5,6)
t = TestSuite("MySuite",[t1,t2])
return (t,t1,t2,m1,m2)
def test_testsuite_hooks(self):
t1 = self.T([2,3])
t1.hook_called = False
t2 = self.T([5,6])
m = self.M(2,3)
def f(test, tests, score, a=None):
self.assertEqual(score,True)
self.assertEqual(a,1)
t1.hook_called = True
ts = TestSuite([t1,t2],name='MySuite',
hooks={t1:
{'f':f,
'kwargs':{'a':1}}
})
ts.judge(m)
self.assertEqual(t1.hook_called,True)
def test_testsuite_set_verbose(self):
from sciunit import TestSuite
t1 = self.T([2,3])
t2 = self.T([5,6])
t = TestSuite("MySuite",[t1,t2])
t.set_verbose(True)
self.assertEqual(t1.verbose,True)
self.assertEqual(t2.verbose,True)
def test_testsuite_set_verbose(self):
t1 = self.T([2,3])
t2 = self.T([5,6])
t = TestSuite([t1,t2])
t.set_verbose(True)
self.assertEqual(t1.verbose,True)
self.assertEqual(t2.verbose,True)
def test_testsuite(self):
t1 = self.T([2,3])
t2 = self.T([5,6])
m1 = self.M(2,3)
m2 = self.M(5,6)
t = TestSuite([t1,t2])
t.judge([m1,m2])
t = TestSuite([t1,t2],skip_models=[m1],include_models=[m2])
t.judge([m1,m2])
def test_testsuite(self):
from sciunit import TestSuite
t1 = self.T([2,3])
t2 = self.T([5,6])
m1 = self.M(2,3)
m2 = self.M(5,6)
t = TestSuite("MySuite",[t1,t2])
t.judge([m1,m2])
t = TestSuite("MySuite",[t1,t2],skip_models=[m1],include_models=[m2])
t.judge([m1,m2])