diff Lib/test/test_array.py @ 86895:1feeeb8992f8 3.3

Issue #18702: All skipped tests now reported as skipped.
author Serhiy Storchaka <storchaka@gmail.com>
date Sun, 03 Nov 2013 21:31:18 +0200
parents 1fd165883a65
children 3650790ca33a a699550bc73b
line wrap: on
line diff
--- a/Lib/test/test_array.py	Sun Nov 03 18:27:40 2013 +0000
+++ b/Lib/test/test_array.py	Sun Nov 03 21:31:18 2013 +0200
@@ -11,6 +11,7 @@
 import io
 import math
 import struct
+import sys
 import warnings
 
 import array
@@ -993,15 +994,15 @@
         s = None
         self.assertRaises(ReferenceError, len, p)
 
+    @unittest.skipUnless(hasattr(sys, 'getrefcount'),
+                         'test needs sys.getrefcount()')
     def test_bug_782369(self):
-        import sys
-        if hasattr(sys, "getrefcount"):
-            for i in range(10):
-                b = array.array('B', range(64))
-            rc = sys.getrefcount(10)
-            for i in range(10):
-                b = array.array('B', range(64))
-            self.assertEqual(rc, sys.getrefcount(10))
+        for i in range(10):
+            b = array.array('B', range(64))
+        rc = sys.getrefcount(10)
+        for i in range(10):
+            b = array.array('B', range(64))
+        self.assertEqual(rc, sys.getrefcount(10))
 
     def test_subclass_with_kwargs(self):
         # SF bug #1486663 -- this used to erroneously raise a TypeError