|
1 | 1 | ## python-exiv2 - Python interface to libexiv2 |
2 | 2 | ## 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] |
4 | 4 | ## |
5 | 5 | ## This program is free software: you can redistribute it and/or |
6 | 6 | ## modify it under the terms of the GNU General Public License as |
@@ -121,17 +121,21 @@ def test_Image(self): |
121 | 121 | self.check_result(image.iccProfileDefined(), bool, False) |
122 | 122 | # test data access |
123 | 123 | image.readMetadata() |
124 | | - self.assertEqual(sys.getrefcount(image), 2) |
| 124 | + if sys.version_info < (3, 14): |
| 125 | + self.assertEqual(sys.getrefcount(image), 2) |
125 | 126 | view = image.data() |
126 | | - self.assertEqual(sys.getrefcount(image), 3) |
| 127 | + if sys.version_info < (3, 14): |
| 128 | + self.assertEqual(sys.getrefcount(image), 3) |
127 | 129 | self.check_result(view, memoryview, self.image_data) |
128 | 130 | self.assertEqual(view.readonly, True) |
129 | 131 | image.writeMetadata() |
130 | | - self.assertEqual(sys.getrefcount(image), 2) |
| 132 | + if sys.version_info < (3, 14): |
| 133 | + self.assertEqual(sys.getrefcount(image), 2) |
131 | 134 | with self.assertRaises(ValueError): |
132 | 135 | view[0] |
133 | 136 | del view |
134 | | - self.assertEqual(sys.getrefcount(image), 2) |
| 137 | + if sys.version_info < (3, 14): |
| 138 | + self.assertEqual(sys.getrefcount(image), 2) |
135 | 139 | # test other methods |
136 | 140 | image.readMetadata() |
137 | 141 | self.check_result(image.byteOrder(), |
@@ -183,6 +187,8 @@ def test_ImageFactory(self): |
183 | 187 | exiv2.ImageType, exiv2.ImageType.jpeg) |
184 | 188 | self.assertIsInstance(factory.open(self.image_path), exiv2.Image) |
185 | 189 |
|
| 190 | + @unittest.skipIf(sys.version_info >= (3, 14), |
| 191 | + 'cannot test optimised ref counts') |
186 | 192 | def test_ref_counts(self): |
187 | 193 | # opening from data keeps reference to buffer |
188 | 194 | self.assertEqual(sys.getrefcount(self.image_data), 2) |
|
0 commit comments