[Checkins] SVN: manuel/trunk/src/manuel/tests.py well, the tests kind of run with nose

Benji York benji at zope.com
Tue Jun 16 00:35:03 EDT 2009


Log message for revision 101029:
  well, the tests kind of run with nose
  

Changed:
  U   manuel/trunk/src/manuel/tests.py

-=-
Modified: manuel/trunk/src/manuel/tests.py
===================================================================
--- manuel/trunk/src/manuel/tests.py	2009-06-16 03:56:08 UTC (rev 101028)
+++ manuel/trunk/src/manuel/tests.py	2009-06-16 04:35:03 UTC (rev 101029)
@@ -14,6 +14,10 @@
 def get_abs_path(p):
     def fake():
         pass
+    # this contorted dance is neccesitated by me wanting to be able to run the
+    # tests with "bin/py src/manuel/tests.py" since bin/py uses execfile, which
+    # means that __file__ -- which I'd normally use here -- will be "bin/py"
+    # not the path to *this* module
     here = os.path.dirname(fake.func_code.co_filename)
     return os.path.join(os.getcwd(), here, p)
 
@@ -41,5 +45,8 @@
 
 test_suite.__test__ = False # tell nose not to treat this as a test case
 
+def run_tests():
+    unittest.TextTestRunner().run(test_suite())
+
 if __name__ == '__main__':
-    unittest.TextTestRunner().run(test_suite())
+    run_tests()



More information about the Checkins mailing list