Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for annotations in @cache_region and use real objects in test…
…s for cached object methods
- Loading branch information
Showing
5 changed files
with
68 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# -*- coding: utf-8 -*- | ||
"""This is a collection of annotated functions used by tests. | ||
They are grouped here to provide an easy way to import them at runtime | ||
to check whenever tests for annotated functions should be skipped or not | ||
on current python version. | ||
""" | ||
from beaker.cache import cache_region | ||
import time | ||
|
||
class AnnotatedAlfredCacher(object): | ||
@cache_region('short_term') | ||
def alfred_self(self, xx: int, y=None) -> str: | ||
return str(time.time()) + str(self) + str(xx) + str(y) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters