From 02ea87fda9b967507442b420433d2b1cff1f6642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ada=C3=ADas=20Magdiel?= Date: Tue, 19 Mar 2024 13:00:42 -0300 Subject: [PATCH] fix(tests): Remove access to attribute value in cache test - Removed access to attribute 'value' as it's unnecessary and causing incorrect cache behavior. Now the test obtains the correct values from the functions directly. --- tests/test_cache_decorator.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_cache_decorator.py b/tests/test_cache_decorator.py index 3852c54..5388136 100644 --- a/tests/test_cache_decorator.py +++ b/tests/test_cache_decorator.py @@ -14,9 +14,9 @@ def test_decoraton_can_set_cache(): def function(): return f"Value: {inc}" - res1 = function().value + res1 = function() inc += 1 - res2 = function().value + res2 = function() assert res1 == "Value: 1" assert res2 == "Value: 1" @@ -29,13 +29,13 @@ def test_decoraton_can_set_cache_with_expiration(): def function(): return f"Value: {inc}" - res1 = function().value + res1 = function() inc += 1 time.sleep(5) - res2 = function().value - res3 = function().value + res2 = function() + res3 = function() assert res1 == "Value: 2" assert res2 == "Value: 3"