Skip to content

Commit

Permalink
Skip test_garbage_collection in implementations other than CPython
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Larralde committed Nov 23, 2018
1 parent 86cb604 commit 6c2af32
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_cached_property.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-

import sys
import time
import unittest
from threading import Lock, Thread
Expand Down Expand Up @@ -154,6 +155,8 @@ def test_threads(self):
self.assert_cached(check, num_threads)
self.assert_cached(check, num_threads)

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

def test_object_independent(self):
Check = CheckFactory(self.cached_property_factory)
Expand Down

0 comments on commit 6c2af32

Please sign in to comment.