[Python-modules-commits] [python-pyld] 12/276: Added test stats printout. TestRunner prints out tests run, number passed and number failed.

Wolfgang Borgert debacle at moszumanska.debian.org
Wed Oct 8 23:47:48 UTC 2014


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to branch master
in repository python-pyld.

commit 3409cda0f56da21f3879bbfaf80bd59731810364
Author: Mike Johnson <mjohnson at digitalbazaar.com>
Date:   Fri Jul 29 16:26:28 2011 -0400

    Added test stats printout.
    TestRunner prints out tests run, number passed and number failed.
---
 tests/TestRunner.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/TestRunner.py b/tests/TestRunner.py
index d05094d..2348b8d 100644
--- a/tests/TestRunner.py
+++ b/tests/TestRunner.py
@@ -88,6 +88,10 @@ class TestRunner:
 
         # FIXME: 
         #self.testFiles.sort()
+        
+        run = 0
+        passed = 0
+        failed = 0
 
         # run the tests from each test file
         for testfile in self.testfiles:
@@ -98,6 +102,7 @@ class TestRunner:
             for test in testgroup['tests']:
                 print 'Test: %s %04d/%s...' % (
                     testgroup['group'], count, test['name']),
+                run += 1
                 count += 1
 
                 # open the input and expected result json files
@@ -126,14 +131,18 @@ class TestRunner:
 
                 # check the expected value against the test result
                 if expectJson == resultJson:
+                    passed += 1
                     print 'PASS'
                     if self.options.verbose:
                         print 'Expect:', json.dumps(expectJson, indent=4)
                         print 'Result:', json.dumps(resultJson, indent=4)
                 else:
+                    failed += 1
                     print 'FAIL'
                     print 'Expect:', json.dumps(expectJson, indent=4)
                     print 'Result:', json.dumps(resultJson, indent=4)
+        
+        print "Tests run: %d, Tests passed: %d, Tests Failed: %d" % (run, passed, failed)
 
 if __name__ == "__main__":
    tr = TestRunner()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-pyld.git



More information about the Python-modules-commits mailing list