pbrady / fastcache

C implementation of Python 3 lru_cache
MIT License
154 stars 19 forks source link

Improve py.test support #30

Closed pbrady closed 10 years ago

pbrady commented 10 years ago

Allow arguments to be passed to test().

Ensure tests which are supposed to raise warnings do, by using the warnings.catch_warning context manager.

In [1]: import fastcache

In [2]: fastcache.test('-k', 'warn')
============================= test session starts ==============================
platform linux -- Python 3.4.1 -- py-1.4.25 -- pytest-2.6.3
collected 29 items 

fastcache/tests/test_clrucache.py ..

======================= 27 tests deselected by '-kwarn' ========================
=================== 2 passed, 27 deselected in 0.10 seconds ====================
Out[2]: True

In [3]: fastcache.test('-k', 'warn')
============================= test session starts ==============================
platform linux -- Python 3.4.1 -- py-1.4.25 -- pytest-2.6.3
collected 29 items 

fastcache/tests/test_clrucache.py ..

======================= 27 tests deselected by '-kwarn' ========================
=================== 2 passed, 27 deselected in 0.04 seconds ====================
Out[3]: True