]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
add a test for reduce's move
authorBenjamin Peterson <benjamin@python.org>
Mon, 18 Aug 2008 02:12:23 +0000 (02:12 +0000)
committerBenjamin Peterson <benjamin@python.org>
Mon, 18 Aug 2008 02:12:23 +0000 (02:12 +0000)
Lib/test/test_py3kwarn.py

index 340e86f42dc7d2d0257582737ce4de2976d83ba9..0dac3d043d8fda532912867dafc3041a97cd207c 100644 (file)
@@ -340,6 +340,12 @@ class TestStdlibRemovals(unittest.TestCase):
                 func = getattr(commands, name)
                 self.assertRaises(DeprecationWarning, func, *([None]*arg_count))
 
+    def test_reduce_move(self):
+        from operator import add
+        with catch_warning(record=False):
+            warnings.filterwarnings("error", "reduce")
+            self.assertRaises(DeprecationWarning, reduce, add, range(10))
+
     def test_mutablestring_removal(self):
         # UserString.MutableString has been removed in 3.0.
         import UserString