How to use the sciunit.TestSuite function in sciunit

To help you get started, we’ve selected a few sciunit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scidash / sciunit / sciunit / unit_test / test_tests.py View on Github external
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])
github scidash / sciunit / sciunit / unit_test / core_tests.py View on Github external
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)
github scidash / sciunit / sciunit / unit_test / test_tests.py View on Github external
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)
github scidash / sciunit / sciunit / unit_test / core_tests.py View on Github external
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)
github scidash / sciunit / sciunit / unit_test / test_tests.py View on Github external
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)
github scidash / sciunit / sciunit / unit_test / test_tests.py View on Github external
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])
github scidash / sciunit / sciunit / unit_test / core_tests.py View on Github external
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])