File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
2
3
+ import sys
3
4
import time
4
5
import unittest
5
6
from threading import Lock , Thread
@@ -154,6 +155,8 @@ def test_threads(self):
154
155
self .assert_cached (check , num_threads )
155
156
self .assert_cached (check , num_threads )
156
157
158
+ @unittest .skipUnless (sys .implementation .name == "cpython" ,
159
+ "unknow garbage collection mechanism" )
157
160
def test_garbage_collection (self ):
158
161
Check = CheckFactory (self .cached_property_factory )
159
162
check = Check ()
@@ -164,7 +167,7 @@ def test_garbage_collection(self):
164
167
# remove the only reference to the Check instance
165
168
del check
166
169
# 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 , {} )
168
171
169
172
def test_object_independent (self ):
170
173
Check = CheckFactory (self .cached_property_factory )
You can’t perform that action at this time.
0 commit comments