This article was originally published by Python Magazine in
March of 2008.
Automated Testing with unittest and Proctor
Listing6.txt
$ proctorbatch --interleaved --no-gc Listing2.py
Writing coverage output to .coverage
Scanning: .
1/ 6 test: Listing2.ErrorTests.test1 ...ERROR in test: Listing2.ErrorTests.test1
Traceback (most recent call last):
File "Listing2.py", line 27, in test1
raise RuntimeError('test1 error')
RuntimeError: test1 error
2/ 6 test: Listing2.ErrorTests.test2 ...ERROR in test: Listing2.ErrorTests.test2
Traceback (most recent call last):
File "Listing2.py", line 30, in test2
raise RuntimeError('test2 error')
RuntimeError: test2 error
3/ 6 test: Listing2.FailingTests.test1 ...FAIL in test: Listing2.FailingTests.test1
Traceback (most recent call last):
File "Listing2.py", line 17, in test1
self.fail('Always fails 1')
AssertionError: Always fails 1
4/ 6 test: Listing2.FailingTests.test2 ...FAIL in test: Listing2.FailingTests.test2
Traceback (most recent call last):
File "Listing2.py", line 21, in test2
self.fail('Always fails 2')
AssertionError: Always fails 2
5/ 6 test: Listing2.PassingTests.test1 ...ok
6/ 6 test: Listing2.PassingTests.test2 ...ok
Ran 6 tests in 0.013s
FAILED (failures=2, errors=2)