summaryrefslogtreecommitdiff
path: root/testing/test_session.py
diff options
context:
space:
mode:
authorholger krekel <holger@merlinux.eu>2010-05-25 16:52:09 +0200
committerholger krekel <holger@merlinux.eu>2010-05-25 16:52:09 +0200
commitc953c7d31315850077c13ee64554c2ae7cb45e01 (patch)
treefc568e1eed402982db897df1ff00231003d52713 /testing/test_session.py
parentfbcf9ec543427034fd26e15b3acdd29cd1c5702b (diff)
downloadpytest-c953c7d31315850077c13ee64554c2ae7cb45e01.tar.gz
fix issue102 by introducing a --maxfailures=NUM option
also print an informative line about "stopped/interrupted" test runs near the end. --HG-- branch : trunk
Diffstat (limited to 'testing/test_session.py')
-rw-r--r--testing/test_session.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/testing/test_session.py b/testing/test_session.py
index b6e0936e2..48834098d 100644
--- a/testing/test_session.py
+++ b/testing/test_session.py
@@ -86,6 +86,16 @@ class SessionTests:
assert failed == 1
assert passed == skipped == 0
+ def test_maxfail(self, testdir):
+ reprec = testdir.inline_runsource("""
+ def test_one(): assert 0
+ def test_two(): assert 0
+ def test_three(): assert 0
+ """, '--maxfail=2')
+ passed, skipped, failed = reprec.countoutcomes()
+ assert failed == 2
+ assert passed == skipped == 0
+
def test_broken_repr(self, testdir):
p = testdir.makepyfile("""
import py