Author: bugman Date: Tue Jan 4 11:33:58 2011 New Revision: 12120 URL: http://svn.gna.org/viewcvs/relax?rev=12120&view=rev Log: Added __init__() to Test_scientific to skip all tests of this class if the module is not installed. The method adds the tests to the status.skipped_tests list and executes the base class __init__() method. Modified: 1.3/test_suite/unit_tests/_generic_fns/_structure/test_scientific.py Modified: 1.3/test_suite/unit_tests/_generic_fns/_structure/test_scientific.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/_generic_fns/_structure/test_scientific.py?rev=12120&r1=12119&r2=12120&view=diff ============================================================================== --- 1.3/test_suite/unit_tests/_generic_fns/_structure/test_scientific.py (original) +++ 1.3/test_suite/unit_tests/_generic_fns/_structure/test_scientific.py Tue Jan 4 11:33:58 2011 @@ -27,6 +27,7 @@ # relax module imports. from data import Relax_data_store; ds = Relax_data_store() +import dep_check from generic_fns.mol_res_spin import Selection from generic_fns.structure.scientific import Scientific_data from relax_io import file_root @@ -35,6 +36,23 @@ class Test_scientific(TestCase): """Unit tests for the functions of the 'generic_fns.structure.scientific' module.""" + + def __init__(self, methodName='runTest'): + """Set up the tests, if scientific Python is installed. + + @keyword methodName: The keyword for unittest.TestCase. + @type methodName: str + """ + + # Missing module. + if not dep_check.scientific_module: + # Store in the status object. + status.skipped_tests.append([methodName, 'Scientific Python', 'unit']) + + # Execute the base class method. + super(Test_scientific, self).__init__(methodName) + + def setUp(self): """Set up for all the Scientific Python PDB structural object unit tests."""