Skip to content

Commit

Permalink
fix(tests): Remove access to attribute value in cache test
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
AdaiasMagdiel committed Mar 19, 2024
1 parent c1dd838 commit 02ea87f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_cache_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit 02ea87f

Please sign in to comment.