From d352db146fb62f0bf73f5a6175a99f53fee6c933 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 20 Jun 2026 00:05:09 +0200 Subject: [PATCH] Trying to fix unit tests with Python 3.14 - it delivers a different reference count under unit test conditions --- testdata/python/dbShapesTest.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/testdata/python/dbShapesTest.py b/testdata/python/dbShapesTest.py index 2be2b5c49..47622e442 100644 --- a/testdata/python/dbShapesTest.py +++ b/testdata/python/dbShapesTest.py @@ -53,13 +53,18 @@ class DBShapesTest(unittest.TestCase): # Issue #2012 (reference count) def test_2(self): + # an empty dict provides the normal reference count + obj = {} + rc = sys.getrefcount(obj) + ly = pya.Layout() + self.assertEqual(sys.getrefcount(ly), rc) top = ly.create_cell("TOP") l1 = ly.layer(1, 0) top.shapes(l1).insert(pya.Box(0, 0, 100, 200)) shapes = top.shapes(l1) - self.assertEqual(sys.getrefcount(shapes), 2) + self.assertEqual(sys.getrefcount(shapes), rc) # Tests the ability to take PolygonWithProperties instead of base class # for setter