summaryrefslogtreecommitdiffstats
path: root/Lib/test/support.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-07-23 20:37:52 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-07-23 20:37:52 (GMT)
commit8dbd8573e513248ca4c105d0f580f47e79ab9ec8 (patch)
tree80acfc84387807f40a2586022ce11e822919e2f5 /Lib/test/support.py
parente02891b459b6a903b71dce1dfb1399419eaefaaf (diff)
parent216a3bc36d31df71544fd9a11b98fca4efeb8182 (diff)
downloadcpython-8dbd8573e513248ca4c105d0f580f47e79ab9ec8.zip
cpython-8dbd8573e513248ca4c105d0f580f47e79ab9ec8.tar.gz
cpython-8dbd8573e513248ca4c105d0f580f47e79ab9ec8.tar.bz2
Issue #12624: It is now possible to fail after the first failure when
running in verbose mode (`-v` or `-W`), by using the `--failfast` (or `-G`) option to regrtest. This is useful with long test suites such as test_io or test_subprocess.
Diffstat (limited to 'Lib/test/support.py')
-rw-r--r--Lib/test/support.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py
index 278348e..8a60ba9 100644
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -55,7 +55,7 @@ __all__ = [
"threading_cleanup", "reap_children", "cpython_only", "check_impl_detail",
"get_attribute", "swap_item", "swap_attr", "requires_IEEE_754",
"TestHandler", "Matcher", "can_symlink", "skip_unless_symlink",
- "import_fresh_module", "requires_zlib", "PIPE_MAX_SIZE"
+ "import_fresh_module", "requires_zlib", "PIPE_MAX_SIZE", "failfast",
]
class Error(Exception):
@@ -179,6 +179,7 @@ use_resources = None # Flag set to [] by regrtest.py
max_memuse = 0 # Disable bigmem tests (they will still be run with
# small sizes, to make sure they work.)
real_max_memuse = 0
+failfast = False
# _original_stdout is meant to hold stdout at the time regrtest began.
# This may be "the real" stdout, or IDLE's emulation of stdout, or whatever.
@@ -1270,7 +1271,8 @@ def refcount_test(test):
def _run_suite(suite):
"""Run tests from a unittest.TestSuite-derived class."""
if verbose:
- runner = unittest.TextTestRunner(sys.stdout, verbosity=2)
+ runner = unittest.TextTestRunner(sys.stdout, verbosity=2,
+ failfast=failfast)
else:
runner = BasicTestRunner()