mailRe: r3033 - /1.3/test_suite/unit_tests/unit_test_runner.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Gary S. Thompson on February 20, 2007 - 14:48:
Edward d'Auvergne wrote:

Gary,

You probably noticed that I've modified your code to return the status
of the unit tests. This was a quick change that I made so that the
--test-suite command line argument functions correctly in the 1.3.0
release. Do you think this will this cause any problems, especially
for stand along operation?


I can't see that it will. At the moment you need to wrap it in a try except wich is messy and is just a flaw in the feature set ;-)

Also, do you know how we could get
individual unit tests to run 'out of the box', i.e. you don't need to
manually set any paths?

Is this inside relax or is stand alone on the command line? If it is the latter that was what I was looking at this morning. You just make unit_test_runner.py executable and give it the name of directory with some unit tests in it or give it the name of a python source file with a single unit test in it... However, as you can see i am having problems with the __builtins__ namespace https://mail.gna.org/public/relax-devel/2007-02/msg00003.html



The other thing to say here is that the use of global variables in a threaded version of relax could be annoying vearing on to the dangerous so we do need to head towards some form of thread local storage fopr 'pseudo globals'...


regards
gary


Cheers,

Edward



On 2/20/07, garyt@xxxxxxxxxxxxxxx <garyt@xxxxxxxxxxxxxxx> wrote:

Author: varioustoxins
Date: Tue Feb 20 11:02:10 2007
New Revision: 3033

URL: http://svn.gna.org/viewcvs/relax?rev=3033&view=rev
Log:
changes to allow command line unit tests to run

Modified:
    1.3/test_suite/unit_tests/unit_test_runner.py

Modified: 1.3/test_suite/unit_tests/unit_test_runner.py
URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/unit_test_runner.py?rev=3033&r1=3032&r2=3033&view=diff


==============================================================================

--- 1.3/test_suite/unit_tests/unit_test_runner.py (original)
+++ 1.3/test_suite/unit_tests/unit_test_runner.py Tue Feb 20 11:02:10 2007
@@ -475,23 +475,35 @@
print 'unit test directory:', unit_test_directory
print 'module paths: ', module_path
print
+
# add UnitTestDirectory to python path
backup_python_path = sys.path[:]
- sys.path.insert(1,unit_test_directory)
- sys.path.insert(1,system_directory)
-
+ #sys.path.insert(1,unit_test_directory)
+
+ # add SystemDirectory to python path
+ sys.path.pop(0)
+ sys.path.insert(0,system_directory)
+
+
+ print sys.path


         #iterate and load unit tests from module path
         finder = Test_finder(unit_test_directory)
         finder.scan_paths()
         if runner == None:
             runner = unittest.TextTestRunner()
-        # add SystemDirectory to python path
+
+
+
+
         # iterate and load files to be tested

         # Run the unit tests and catch the TestResult object.
         results = runner.run(finder.suite)

+        # restore sys  path
+        sys.path=backup_python_path
+
         # Return the result of all the tests.
         return results.wasSuccessful()



_______________________________________________
relax (http://nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits


.



--
-------------------------------------------------------------------
Dr Gary Thompson
Astbury Centre for Structural Molecular Biology,
University of Leeds, Astbury Building,
Leeds, LS2 9JT, West-Yorkshire, UK             Tel. +44-113-3433024
email: garyt@xxxxxxxxxxxxxxx                   Fax  +44-113-2331407
-------------------------------------------------------------------





Related Messages


Powered by MHonArc, Updated Tue Feb 20 15:40:28 2007