Author: bugman Date: Tue Apr 17 18:32:17 2012 New Revision: 15768 URL: http://svn.gna.org/viewcvs/relax?rev=15768&view=rev Log: The test suite is now only imported in the test modes of operation. This should also speed up program initialisation. Modified: 1.3/relax.py Modified: 1.3/relax.py URL: http://svn.gna.org/viewcvs/relax/1.3/relax.py?rev=15768&r1=15767&r2=15768&view=diff ============================================================================== --- 1.3/relax.py (original) +++ 1.3/relax.py Tue Apr 17 18:32:17 2012 @@ -12,7 +12,7 @@ # # # relax, a program for relaxation data analysis. # # # -# Copyright (C) 2001-2006 Edward d'Auvergne # +# Copyright (C) 2001-2012 Edward d'Auvergne # # Copyright (C) 2006-2012 the relax development team # # # # This program is free software; you can redistribute it and/or modify # @@ -58,7 +58,6 @@ import relax_errors from relax_io import io_streams_log, io_streams_tee import relax_warnings -from test_suite.test_suite_runner import Test_suite_runner from version import version # Modify the environmental variables. @@ -207,6 +206,9 @@ # Execute the relax test suite elif self.mode == 'test suite': + # Only import the module in the test modes (to improve program start up speeds). + from test_suite.test_suite_runner import Test_suite_runner + # Load the interpreter and turn intros on. self.interpreter = interpreter.Interpreter(show_script=False, quit=False, raise_relax_error=True) self.interpreter.on() @@ -217,6 +219,9 @@ # Execute the relax system tests. elif self.mode == 'system tests': + # Only import the module in the test modes (to improve program start up speeds). + from test_suite.test_suite_runner import Test_suite_runner + # Load the interpreter and turn intros on. self.interpreter = interpreter.Interpreter(show_script=False, quit=False, raise_relax_error=True) self.interpreter.on() @@ -227,12 +232,18 @@ # Execute the relax unit tests. elif self.mode == 'unit tests': + # Only import the module in the test modes (to improve program start up speeds). + from test_suite.test_suite_runner import Test_suite_runner + # Run the tests. runner = Test_suite_runner(self.tests) runner.run_unit_tests() # Execute the relax GUI tests. elif self.mode == 'GUI tests': + # Only import the module in the test modes (to improve program start up speeds). + from test_suite.test_suite_runner import Test_suite_runner + # Run the tests. runner = Test_suite_runner(self.tests) runner.run_gui_tests()