Skip to content

Commit fe98ad0

Browse files
Disable some refcount tests if Python >= 3.14
1 parent 09ac20c commit fe98ad0

File tree

6 files changed

+13
-1
lines changed

6 files changed

+13
-1
lines changed

tests/test_basicio.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ def test_MemIo(self):
224224
with self.assertWarns(DeprecationWarning):
225225
self.assertEqual(memoryview(io), self.data + b'+fred+jim')
226226

227+
@unittest.skipIf(sys.version_info >= (3, 14),
228+
'cannot test optimised ref counts')
227229
def test_ref_counts(self):
228230
# MemIo keeps a reference to the data buffer
229231
count = sys.getrefcount(self.data)

tests/test_exif.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ def test_pointers(self):
310310
self.assertEqual(datum_pointer, datum)
311311
self.assertEqual(datum_pointer, datum_iter)
312312

313+
@unittest.skipIf(sys.version_info >= (3, 14),
314+
'cannot test optimised ref counts')
313315
def test_ref_counts(self):
314316
self.image.readMetadata()
315317
# exifData keeps a reference to image

tests/test_image.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## python-exiv2 - Python interface to libexiv2
22
## http://github.com/jim-easterbrook/python-exiv2
3-
## Copyright (C) 2023-24 Jim Easterbrook [email protected]
3+
## Copyright (C) 2023-25 Jim Easterbrook [email protected]
44
##
55
## This program is free software: you can redistribute it and/or
66
## modify it under the terms of the GNU General Public License as
@@ -183,6 +183,8 @@ def test_ImageFactory(self):
183183
exiv2.ImageType, exiv2.ImageType.jpeg)
184184
self.assertIsInstance(factory.open(self.image_path), exiv2.Image)
185185

186+
@unittest.skipIf(sys.version_info >= (3, 14),
187+
'cannot test optimised ref counts')
186188
def test_ref_counts(self):
187189
# opening from data keeps reference to buffer
188190
self.assertEqual(sys.getrefcount(self.image_data), 2)

tests/test_iptc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ def test_IptcDatum(self):
204204
del datum2
205205
self._test_datum(datum)
206206

207+
@unittest.skipIf(sys.version_info >= (3, 14),
208+
'cannot test optimised ref counts')
207209
def test_ref_counts(self):
208210
self.image.readMetadata()
209211
# iptcData keeps a reference to image

tests/test_preview.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ def test_PreviewProperties(self):
116116
with self.assertRaises(TypeError):
117117
properties['fred'] = 123
118118

119+
@unittest.skipIf(sys.version_info >= (3, 14),
120+
'cannot test optimised ref counts')
119121
def test_ref_counts(self):
120122
# manager keeps reference to image
121123
self.assertEqual(sys.getrefcount(self.image), 2)

tests/test_xmp.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ def test_pointers(self):
246246
self.assertEqual(datum_pointer, datum)
247247
self.assertEqual(datum_pointer, datum_iter)
248248

249+
@unittest.skipIf(sys.version_info >= (3, 14),
250+
'cannot test optimised ref counts')
249251
def test_ref_counts(self):
250252
self.image.readMetadata()
251253
# xmpData keeps a reference to image

0 commit comments

Comments
 (0)