dabo Commit
Revision 2915
Date: 2007-03-15 11:32:43 -0700 (Thu, 15 Mar 2007)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/2915

Changed:
U   trunk/tests/unitTests/masterTestSuite.py

Log:
Made the importing of coverage optional for masterTestSuite.

Nate, where do I find:
        coverage
        mock

I do have a pmock package, that has a Mock(). Would that work?



Diff:
Modified: trunk/tests/unitTests/masterTestSuite.py
===================================================================
--- trunk/tests/unitTests/masterTestSuite.py    2007-03-15 00:05:53 UTC (rev 
2914)
+++ trunk/tests/unitTests/masterTestSuite.py    2007-03-15 18:32:43 UTC (rev 
2915)
@@ -1,20 +1,26 @@
-"""Master test control for the test suite.  Tests for all Tiers plus the lib 
section of Dabo are imported and run from here.
-
-This will import the DB, Biz, Lib, and UI Tiers for the test.  We will add the 
test files manually in the __init__.py files
-in each module.  The init files and every Test Case file must provide a 
function suite() which will return a unittest.TestSuite
-object that encompasses the all of the test cases and suite within that file 
or module.  See the sample init and testCase files
-for more information.
+"""Master test control for the test suite.  
+
+This will import the DB, Biz, Lib, and UI Tiers for the test.  We will add 
+the test files manually in the __init__.py files in each module.  The init 
+files and every Test Case file must provide a function suite() which will 
+return a unittest.TestSuite object that encompasses the all of the test 
+cases and suite within that file or module.  See the sample init and 
+testCase files for more information.
 """
 
-import unittest
-import coverage
+import unittest
+try:
+       import coverage
+except ImportError:
+       coverage = None
 import sys
+
+if coverage:
+       coverage.erase()
+       coverage.start()
 
-coverage.erase()
-coverage.start()
+       coverage.exclude('if __name__ == "__main__":')
 
-coverage.exclude('if __name__ == "__main__":')
-
 import dabo
 dabo.ui.loadUI('wx')
 
@@ -34,8 +40,9 @@
 
 allTiersTestSuite = unittest.TestSuite(suiteList)
 unittest.TextTestRunner(verbosity=2).run(allTiersTestSuite)
-
-coverage.stop()
-#You can uncomment this to get test coverage on a particular module, but if 
you want to
-#see the entire report for dabo, run "python CoverageReport.py".  I would pipe 
it to a file though
-#coverage.report([dabo.dColors, dabo.dObject, dabo])
\ No newline at end of file
+
+if coverage:
+       coverage.stop()
+       #You can uncomment this to get test coverage on a particular module, 
but if you want to
+       #see the entire report for dabo, run "python CoverageReport.py".  I 
would pipe it to a file though
+       #coverage.report([dabo.dColors, dabo.dObject, dabo])




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to