Merged revisions 79195,79425,79427,79450 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.
........
  r79425 | florent.xicluna | 2010-03-25 21:32:07 +0100 (jeu, 25 mar 2010) | 2 lines

  Syntax cleanup `== None` -> `is None`
........
  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.
........
diff --git a/Lib/test/test_warnings.py b/Lib/test/test_warnings.py
index 71944cd..fab8086 100644
--- a/Lib/test/test_warnings.py
+++ b/Lib/test/test_warnings.py
@@ -37,11 +37,15 @@
     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):
@@ -204,6 +208,7 @@
     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)