Skip to content

Commit 6c2af32

Browse files
author
Martin Larralde
committed
Skip test_garbage_collection in implementations other than CPython
1 parent 86cb604 commit 6c2af32

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_cached_property.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3+
import sys
34
import time
45
import unittest
56
from threading import Lock, Thread
@@ -154,6 +155,8 @@ def test_threads(self):
154155
self.assert_cached(check, num_threads)
155156
self.assert_cached(check, num_threads)
156157

158+
@unittest.skipUnless(sys.implementation.name == "cpython",
159+
"unknow garbage collection mechanism")
157160
def test_garbage_collection(self):
158161
Check = CheckFactory(self.cached_property_factory)
159162
check = Check()
@@ -164,7 +167,7 @@ def test_garbage_collection(self):
164167
# remove the only reference to the Check instance
165168
del check
166169
# make sure the cache of the deleted object was removed
167-
self.assertEqual(len(Check.add_cached.cache), 0)
170+
self.assertEqual(Check.add_cached.cache, {})
168171

169172
def test_object_independent(self):
170173
Check = CheckFactory(self.cached_property_factory)

0 commit comments

Comments
 (0)