summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_buffer.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_buffer.py')
-rw-r--r--Lib/test/test_buffer.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py
index 94fc9d4..8d6902e 100644
--- a/Lib/test/test_buffer.py
+++ b/Lib/test/test_buffer.py
@@ -24,6 +24,7 @@ import warnings
import sys, array, io, os
from decimal import Decimal
from fractions import Fraction
+from test.support import warnings_helper
try:
from _testbuffer import *
@@ -3217,12 +3218,6 @@ class TestBufferProtocol(unittest.TestCase):
nd[0] = (-1, float('nan'))
self.assertNotEqual(memoryview(nd), nd)
- # Depends on issue #15625: the struct module does not understand 'u'.
- a = array.array('u', 'xyz')
- v = memoryview(a)
- self.assertNotEqual(a, v)
- self.assertNotEqual(v, a)
-
# Some ctypes format strings are unknown to the struct module.
if ctypes:
# format: "T{>l:x:>l:y:}"
@@ -3236,6 +3231,15 @@ class TestBufferProtocol(unittest.TestCase):
self.assertNotEqual(point, a)
self.assertRaises(NotImplementedError, a.tolist)
+ @warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-80480 array('u')
+ def test_memoryview_compare_special_cases_deprecated_u_type_code(self):
+
+ # Depends on issue #15625: the struct module does not understand 'u'.
+ a = array.array('u', 'xyz')
+ v = memoryview(a)
+ self.assertNotEqual(a, v)
+ self.assertNotEqual(v, a)
+
def test_memoryview_compare_ndim_zero(self):
nd1 = ndarray(1729, shape=[], format='@L')