From e6acaf651e5798250c1f28265714e0b9edb850da Mon Sep 17 00:00:00 2001 From: Alan Saul Date: Mon, 11 Mar 2013 18:05:25 +0000 Subject: [PATCH] Should now test all (although upon error it stops trying to generate any more) --- GPy/testing/examples_tests.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/GPy/testing/examples_tests.py b/GPy/testing/examples_tests.py index 9636b286..5ae741ee 100644 --- a/GPy/testing/examples_tests.py +++ b/GPy/testing/examples_tests.py @@ -29,11 +29,11 @@ def checkgrads_generator(model): """ def model_checkgrads(model): - assert model.checkgrad() is True + assert model.checkgrad() def model_instance(model): - assert model.checkgrad() is True + assert isinstance(model, GPy.core.model) def test_models(): @@ -45,7 +45,7 @@ def test_models(): print "MODULE", module_examples print "Before" print inspect.getmembers(module_examples, predicate=inspect.isfunction) - functions = [ func for func in inspect.getmembers(module_examples, predicate=inspect.isfunction) if func[0].startswith('_') is False ] + functions = [ func for func in inspect.getmembers(module_examples, predicate=inspect.isfunction) if func[0].startswith('_') is False ][::-1] print "After" print functions for example in functions: @@ -72,3 +72,4 @@ def test_models(): if __name__ == "__main__": print "Running unit tests, please be (very) patient..." + unittest.main()