diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-28 11:42:38 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-28 11:42:38 (GMT) |
commit | 9b0e9180e220cb455881de9f4d922a4e2ce0435f (patch) | |
tree | 1424071a8eaf3cc2cee475e010d1fe0d6dc6f7f0 /Lib/test/test_warnings.py | |
parent | e39b4455771f97fe1cc4027badb066542312a319 (diff) | |
download | cpython-9b0e9180e220cb455881de9f4d922a4e2ce0435f.zip cpython-9b0e9180e220cb455881de9f4d922a4e2ce0435f.tar.gz cpython-9b0e9180e220cb455881de9f4d922a4e2ce0435f.tar.bz2 |
Note: only the relevant parts of r79474 are merged.
Merged revisions 78793,78798-78799,78977,79095,79196,79474 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r78793 | florent.xicluna | 2010-03-08 13:25:35 +0100 (lun, 08 mar 2010) | 2 lines
Fix macpath to deal with bytes
................
r78798 | florent.xicluna | 2010-03-08 14:32:17 +0100 (lun, 08 mar 2010) | 18 lines
Merged revisions 78777,78787,78790 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78777 | florent.xicluna | 2010-03-08 00:49:03 +0100 (lun, 08 mar 2010) | 4 lines
Backport the Popen.poll() protection from subprocess to multiprocessing. See #1731717.
It should fix transient failures on test_multiprocessing.
........
r78787 | florent.xicluna | 2010-03-08 08:21:16 +0100 (lun, 08 mar 2010) | 2 lines
Don't fail on a debug() statement, if the worker PID is (still) None.
........
r78790 | florent.xicluna | 2010-03-08 12:01:39 +0100 (lun, 08 mar 2010) | 2 lines
On finalize, don't try to join not started process.
........
................
r78799 | florent.xicluna | 2010-03-08 15:44:41 +0100 (lun, 08 mar 2010) | 2 lines
Fix ntpath abspath to deal with bytes.
................
r78977 | florent.xicluna | 2010-03-15 14:14:39 +0100 (lun, 15 mar 2010) | 2 lines
Fix \xhh specs, #1889. (an oversight of r60193, r60210).
................
r79095 | florent.xicluna | 2010-03-19 15:40:31 +0100 (ven, 19 mar 2010) | 2 lines
Rename test.test_support to test.support for 3.x.
................
r79196 | florent.xicluna | 2010-03-21 13:29:50 +0100 (dim, 21 mar 2010) | 9 lines
Merged revisions 79195 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r79195 | florent.xicluna | 2010-03-21 13:27:20 +0100 (dim, 21 mar 2010) | 2 lines
Issue #8179: Fix macpath.realpath() on a non-existing path.
........
................
r79474 | florent.xicluna | 2010-03-28 01:25:02 +0100 (dim, 28 mar 2010) | 33 lines
Merged revisions 79297,79310,79382,79425-79427,79450 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r79297 | florent.xicluna | 2010-03-22 18:18:18 +0100 (lun, 22 mar 2010) | 2 lines
#7668: Fix test_httpservers failure when sys.executable contains non-ASCII bytes.
........
r79310 | florent.xicluna | 2010-03-22 23:52:11 +0100 (lun, 22 mar 2010) | 2 lines
Issue #8205: Remove the "Modules" directory from sys.path when Python is running from the build directory (POSIX only).
........
r79382 | florent.xicluna | 2010-03-24 20:33:25 +0100 (mer, 24 mar 2010) | 2 lines
Skip tests which depend on multiprocessing.sharedctypes, if _ctypes is not available.
........
r79425 | florent.xicluna | 2010-03-25 21:32:07 +0100 (jeu, 25 mar 2010) | 2 lines
Syntax cleanup `== None` -> `is None`
........
r79426 | florent.xicluna | 2010-03-25 21:33:49 +0100 (jeu, 25 mar 2010) | 2 lines
#8207: Fix test_pep277 on OS X
........
r79427 | florent.xicluna | 2010-03-25 21:39:10 +0100 (jeu, 25 mar 2010) | 2 lines
Fix test_unittest and test_warnings when running "python -Werror -m test.regrtest"
........
r79450 | florent.xicluna | 2010-03-26 20:32:44 +0100 (ven, 26 mar 2010) | 2 lines
Ensure that the failed or unexpected tests are sorted before printing.
........
................
Diffstat (limited to 'Lib/test/test_warnings.py')
-rw-r--r-- | Lib/test/test_warnings.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_warnings.py b/Lib/test/test_warnings.py index 7393d25..c1e29b8 100644 --- a/Lib/test/test_warnings.py +++ b/Lib/test/test_warnings.py @@ -27,11 +27,15 @@ def warnings_state(module): except NameError: pass original_warnings = warning_tests.warnings + original_filters = module.filters try: + module.filters = original_filters[:] + module.simplefilter("once") warning_tests.warnings = module yield finally: warning_tests.warnings = original_warnings + module.filters = original_filters class BaseTest(unittest.TestCase): @@ -194,6 +198,7 @@ class WarnTests(unittest.TestCase): def test_message(self): with original_warnings.catch_warnings(record=True, module=self.module) as w: + self.module.simplefilter("once") for i in range(4): text = 'multi %d' %i # Different text on each call. self.module.warn(text) @@ -206,6 +211,7 @@ class WarnTests(unittest.TestCase): for ob in (Warning, None, 42): with original_warnings.catch_warnings(record=True, module=self.module) as w: + self.module.simplefilter("once") self.module.warn(ob) # Don't directly compare objects since # ``Warning() != Warning()``. |