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 Dec 28, 2018
1 parent 2fd46da commit 55763c1
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 platform
import time
import unittest
from threading import Lock, Thread
Expand Down Expand Up @@ -151,6 +152,8 @@ def test_threads(self):
self.assert_cached(check, num_threads)
self.assert_cached(check, num_threads)

@unittest.skipUnless(platform.python_implementation() == "CPython",
"unknow garbage collection mechanism")
def test_garbage_collection(self):
Check = CheckFactory(self.cached_property_factory)
check = Check()
Expand All @@ -161,7 +164,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 55763c1

Please sign in to comment.