[Zope3-checkins]
SVN: zope.testing/trunk/src/zope/testing/testrunner
Show the list of tests with errors/failures at a smaller
verbosity level.
Marius Gedminas
marius at pov.lt
Wed Jul 18 11:41:49 EDT 2007
Log message for revision 78117:
Show the list of tests with errors/failures at a smaller verbosity level.
Changed:
U zope.testing/trunk/src/zope/testing/testrunner-errors.txt
U zope.testing/trunk/src/zope/testing/testrunner.py
-=-
Modified: zope.testing/trunk/src/zope/testing/testrunner-errors.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner-errors.txt 2007-07-18 15:25:57 UTC (rev 78116)
+++ zope.testing/trunk/src/zope/testing/testrunner-errors.txt 2007-07-18 15:41:48 UTC (rev 78117)
@@ -130,7 +130,8 @@
test. In addition, the test runner returned True, indicating that
there was an error.
-If we ask for single verbosity, the dotted output will be interrupted:
+If we ask for verbosity, the dotted output will be interrupted, and
+there'll be a summary of the errors at the end of the test:
>>> sys.argv = 'test --tests-pattern ^sampletests(f|_e|_f)?$ -uv'.split()
>>> testrunner.run(defaults)
@@ -207,9 +208,17 @@
................................................................................................
<BLANKLINE>
Ran 200 tests with 3 failures and 1 errors in 0.040 seconds.
+ <BLANKLINE>
+ Tests with errors:
+ test3 (sample2.sampletests_e.Test)
+ <BLANKLINE>
+ Tests with failures:
+ eek (sample2.sampletests_e)
+ testrunner-ex/sample2/e.txt
+ test (sample2.sampletests_f.Test)
True
-Similarly for progress output:
+Similarly for progress output, the progress ticker will be interrupted:
>>> sys.argv = ('test --tests-pattern ^sampletests(f|_e|_f)?$ -u -ssample2'
... ' -p').split()
@@ -372,138 +381,9 @@
Ran 56 tests with 3 failures and 1 errors in 0.054 seconds.
True
-For greater levels of verbosity, we summarize the errors at the end of
-the test
+If you also want a summary of errors at the end, ask for verbosity as well
+as progress output.
- >>> sys.argv = ('test --tests-pattern ^sampletests(f|_e|_f)?$ -u -ssample2'
- ... ' -vv').split()
- >>> testrunner.run(defaults)
- ... # doctest: +NORMALIZE_WHITESPACE
- Running tests at level 1
- Running unit tests:
- Running:
- eek (sample2.sampletests_e)
- <BLANKLINE>
- Failure in test eek (sample2.sampletests_e)
- Failed doctest test for sample2.sampletests_e.eek
- File "testrunner-ex/sample2/sampletests_e.py", line 28, in eek
- <BLANKLINE>
- ----------------------------------------------------------------------
- File "testrunner-ex/sample2/sampletests_e.py", line 30,
- in sample2.sampletests_e.eek
- Failed example:
- f()
- Exception raised:
- Traceback (most recent call last):
- File ".../doctest.py", line 1256, in __run
- compileflags, 1) in test.globs
- File "<doctest sample2.sampletests_e.eek[0]>", line 1, in ?
- f()
- File "testrunner-ex/sample2/sampletests_e.py", line 19, in f
- g()
- File "testrunner-ex/sample2/sampletests_e.py", line 24, in g
- x = y + 1
- NameError: global name 'y' is not defined
- <BLANKLINE>
- <BLANKLINE>
- test1 (sample2.sampletests_e.Test)
- test2 (sample2.sampletests_e.Test)
- test3 (sample2.sampletests_e.Test)
- <BLANKLINE>
- Error in test test3 (sample2.sampletests_e.Test)
- Traceback (most recent call last):
- File "testrunner-ex/sample2/sampletests_e.py", line 43, in test3
- f()
- File "testrunner-ex/sample2/sampletests_e.py", line 19, in f
- g()
- File "testrunner-ex/sample2/sampletests_e.py", line 24, in g
- x = y + 1
- NameError: global name 'y' is not defined
- <BLANKLINE>
- <BLANKLINE>
- test4 (sample2.sampletests_e.Test)
- test5 (sample2.sampletests_e.Test)
- testrunner-ex/sample2/e.txt
- <BLANKLINE>
- Failure in test testrunner-ex/sample2/e.txt
- Failed doctest test for e.txt
- File "testrunner-ex/sample2/e.txt", line 0
- <BLANKLINE>
- ----------------------------------------------------------------------
- File "testrunner-ex/sample2/e.txt", line 4, in e.txt
- Failed example:
- f()
- Exception raised:
- Traceback (most recent call last):
- File ".../doctest.py", line 1256, in __run
- compileflags, 1) in test.globs
- File "<doctest e.txt[1]>", line 1, in ?
- f()
- File "<doctest e.txt[0]>", line 2, in f
- return x
- NameError: global name 'x' is not defined
- <BLANKLINE>
- <BLANKLINE>
- test (sample2.sampletests_f.Test)
- <BLANKLINE>
- Failure in test test (sample2.sampletests_f.Test)
- Traceback (most recent call last):
- File "testrunner-ex/sample2/sampletests_f.py", line 21, in test
- self.assertEqual(1,0)
- File ".../unittest.py", line 302, in failUnlessEqual
- raise self.failureException, \
- AssertionError: 1 != 0
- <BLANKLINE>
- <BLANKLINE>
- test_x1 (sample2.sample21.sampletests.TestA)
- test_y0 (sample2.sample21.sampletests.TestA)
- test_z0 (sample2.sample21.sampletests.TestA)
- test_x0 (sample2.sample21.sampletests.TestB)
- test_y1 (sample2.sample21.sampletests.TestB)
- test_z0 (sample2.sample21.sampletests.TestB)
- test_1 (sample2.sample21.sampletests.TestNotMuch)
- test_2 (sample2.sample21.sampletests.TestNotMuch)
- test_3 (sample2.sample21.sampletests.TestNotMuch)
- test_x0 (sample2.sample21.sampletests)
- test_y0 (sample2.sample21.sampletests)
- test_z1 (sample2.sample21.sampletests)
- testrunner-ex/sample2/sample21/../../sampletests.txt
- test_x1 (sample2.sampletests.test_1.TestA)
- test_y0 (sample2.sampletests.test_1.TestA)
- test_z0 (sample2.sampletests.test_1.TestA)
- test_x0 (sample2.sampletests.test_1.TestB)
- test_y1 (sample2.sampletests.test_1.TestB)
- test_z0 (sample2.sampletests.test_1.TestB)
- test_1 (sample2.sampletests.test_1.TestNotMuch)
- test_2 (sample2.sampletests.test_1.TestNotMuch)
- test_3 (sample2.sampletests.test_1.TestNotMuch)
- test_x0 (sample2.sampletests.test_1)
- test_y0 (sample2.sampletests.test_1)
- test_z1 (sample2.sampletests.test_1)
- testrunner-ex/sample2/sampletests/../../sampletests.txt
- test_x1 (sample2.sampletests.testone.TestA)
- test_y0 (sample2.sampletests.testone.TestA)
- test_z0 (sample2.sampletests.testone.TestA)
- test_x0 (sample2.sampletests.testone.TestB)
- test_y1 (sample2.sampletests.testone.TestB)
- test_z0 (sample2.sampletests.testone.TestB)
- test_1 (sample2.sampletests.testone.TestNotMuch)
- test_2 (sample2.sampletests.testone.TestNotMuch)
- test_3 (sample2.sampletests.testone.TestNotMuch)
- test_x0 (sample2.sampletests.testone)
- test_y0 (sample2.sampletests.testone)
- test_z1 (sample2.sampletests.testone)
- testrunner-ex/sample2/sampletests/../../sampletests.txt
- Ran 56 tests with 3 failures and 1 errors in 0.060 seconds.
- <BLANKLINE>
- Tests with errors:
- test3 (sample2.sampletests_e.Test)
- <BLANKLINE>
- Tests with failures:
- eek (sample2.sampletests_e)
- testrunner-ex/sample2/e.txt
- test (sample2.sampletests_f.Test)
- True
Suppressing multiple doctest errors
-----------------------------------
@@ -901,13 +781,11 @@
There was a bug preventing decent error reporting when a result contained
unicode and another not:
- >>> sys.argv = 'test --tests-pattern ^unicode$ -uv'.split()
- >>> testrunner.run(defaults)
- Running tests at level 1
+ >>> sys.argv = 'test --tests-pattern ^unicode$ -u'.split()
+ >>> testrunner.run(defaults) # doctest: +REPORT_NDIFF
Running unit tests:
- Running:
- ...
<BLANKLINE>
+ <BLANKLINE>
Failure testrunner-ex/unicode.txt
Failed doctest test for unicode.txt
testrunner-ex/unicode.txt", line 0
@@ -929,7 +807,6 @@
Got:
'xyz'
<BLANKLINE>
- <BLANKLINE>
Ran 3 tests with 1 failures and 0 errors in N.NNN seconds.
True
Modified: zope.testing/trunk/src/zope/testing/testrunner.py
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner.py 2007-07-18 15:25:57 UTC (rev 78116)
+++ zope.testing/trunk/src/zope/testing/testrunner.py 2007-07-18 15:41:48 UTC (rev 78117)
@@ -1068,7 +1068,7 @@
print >> original_stderr, ' '.join(str(test).strip().split('\n'))
else:
- if options.verbose > 1:
+ if options.verbose:
output.tests_with_errors(errors)
output.tests_with_failures(failures)
More information about the Zope3-Checkins
mailing list