From 70c3d347316a7ece545a03db2a776594dc338243 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Tue, 10 May 2016 10:29:37 +0200 Subject: [PATCH] Only call _invalidate_all if it exists the memoize decorator adds the _invalidate_all function when called. Due to the deferred initialization that may not happen in a test. --- tests/api_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/api_tests.py b/tests/api_tests.py index 14949096..b7ce39ad 100644 --- a/tests/api_tests.py +++ b/tests/api_tests.py @@ -48,7 +48,8 @@ class TestApiCalls(unittest.TestCase): def tearDown(self): """Clean internal cache""" - self.api._invalidate_all() + if hasattr(self.api, '_invalidate_all'): + self.api._invalidate_all() def test_ring_packages(self): """