使用/不使用缓存进行测试的实用程序
switchcache的Python项目详细描述
switchcache
===
'fuga':'hoge'
>
init(configure)
>
@with_cache
def test_with_cache():
<;此函数中启用了缓存;
@no_cache
@no_cache
<;此函数中禁用了缓存>;
```>br/>
`` ` ` ` ` `>来自switchcache import cache的python带缓存的测试:
<;cache enabled inside”with“>;
<;cache enabled inside”with“>;
<;cache enabled inside”with“>;
```
` ` ` ` `
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `',“foo”]
@times(5)
def test_5_次:
return s
>;>;test_5_次('bar')
['bar','bar','bar','bar','bar','bar','bar']
````
===
'fuga':'hoge'
>
init(configure)
>
@with_cache
def test_with_cache():
<;此函数中启用了缓存;
@no_cache
@no_cache
<;此函数中禁用了缓存>;
```>br/>
`` ` ` ` ` `>来自switchcache import cache的python带缓存的测试:
<;cache enabled inside”with“>;
<;cache enabled inside”with“>;
<;cache enabled inside”with“>;
```
` ` ` ` `
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `',“foo”]
@times(5)
def test_5_次:
return s
>;>;test_5_次('bar')
['bar','bar','bar','bar','bar','bar','bar']
````