Beispiel #1
0
    def test_problem_deriv_test(self):

        prob = Problem()
        prob.root = Group()
        prob.root.add('comp', SimpleCompWrongDeriv())
        prob.root.add('p1', IndepVarComp('x', 2.0))
        prob.root.connect('p1.x', 'comp.x')

        prob.setup(check=False)
        prob.run()

        data = prob.check_partial_derivatives(out_stream=None)

        # suppress printed output from problem_derivatives_check()
        sysout = sys.stdout
        devnull = open(os.devnull, 'w')

        try:
            sys.stdout = devnull
            problem_derivatives_check(self, prob)
        except AssertionError as err:
            sys.stdout = sysout
            self.assertIn("not less than or equal to 1e-05", err.args[0])
        finally:
            sys.stdout = sysout
Beispiel #2
0
    def test_problem_deriv_test(self):

        prob = Problem()
        prob.root = Group()
        prob.root.add('comp', SimpleCompWrongDeriv())
        prob.root.add('p1', IndepVarComp('x', 2.0))
        prob.root.connect('p1.x', 'comp.x')

        prob.setup(check=False)
        prob.run()

        data = prob.check_partial_derivatives(out_stream=None)

        # suppress printed output from problem_derivatives_check()
        sysout = sys.stdout
        devnull = open(os.devnull, 'w')

        try:
            sys.stdout = devnull
            problem_derivatives_check(self, prob)
        except AssertionError as err:
            sys.stdout = sysout
            self.assertIn("not less than or equal to 1e-05", err.args[0])
        finally:
            sys.stdout = sysout
Beispiel #3
0
    def test_problem_deriv_test(self):

        prob = Problem()
        prob.root = Group()
        prob.root.add('comp', SimpleCompWrongDeriv())
        prob.root.add('p1', IndepVarComp('x', 2.0))
        prob.root.connect('p1.x', 'comp.x')

        prob.setup(check=False)
        prob.run()

        data = prob.check_partial_derivatives(out_stream=None)

        try:
            problem_derivatives_check(self, prob)
        except AssertionError as err:
            self.assertIn("not less than or equal to 1e-05", err.args[0])