]> granicus.if.org Git - python/commitdiff
Fix pickling test in test_memoryio.
authorAlexandre Vassalotti <alexandre@peadrop.com>
Sun, 14 Apr 2013 07:56:39 +0000 (00:56 -0700)
committerAlexandre Vassalotti <alexandre@peadrop.com>
Sun, 14 Apr 2013 07:56:39 +0000 (00:56 -0700)
The test was closing the orginal object instead the copy. This didn't result
in visible failures because the loop range was incorrect as well.

Lib/test/test_memoryio.py

index e5db94566fa94ba93554c4267386155379cef193..d611a3138b265894b0f571ee7b9208d7ccc9943f 100644 (file)
@@ -379,8 +379,8 @@ class MemoryTestMixin:
                 self.assertEqual(obj.__class__, obj2.__class__)
                 self.assertEqual(obj.foo, obj2.foo)
                 self.assertEqual(obj.tell(), obj2.tell())
-                obj.close()
-                self.assertRaises(ValueError, pickle.dumps, obj, proto)
+                obj2.close()
+                self.assertRaises(ValueError, pickle.dumps, obj2, proto)
         del __main__.PickleTestMemIO