summaryrefslogtreecommitdiff
path: root/Lib/test/test_array.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_array.py')
-rw-r--r--Lib/test/test_array.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 07c9bf999b..10d99462fd 100644
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -394,7 +394,9 @@ class BaseTest:
self.assertEqual(a, b)
def test_tofromstring(self):
- nb_warnings = 4
+ # Warnings not raised when arguments are incorrect as Argument Clinic
+ # handles that before the warning can be raised.
+ nb_warnings = 2
with warnings.catch_warnings(record=True) as r:
warnings.filterwarnings("always",
message=r"(to|from)string\(\) is deprecated",
@@ -1039,6 +1041,11 @@ class BaseTest:
a = array.array(self.typecode, "foo")
a = array.array(self.typecode, array.array('u', 'foo'))
+ @support.cpython_only
+ def test_obsolete_write_lock(self):
+ from _testcapi import getbuffer_with_null_view
+ a = array.array('B', b"")
+ self.assertRaises(BufferError, getbuffer_with_null_view, a)
class StringTest(BaseTest):