Skip to content

Commit

Permalink
adding coverage for exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy McFadden committed Sep 1, 2017
1 parent c834eed commit 94d549d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@
1. wait for Travis to show passing
1. build the packages: `python setup.py sdist bdist_wheel`
1. upload to pypi: `twine upload dist/*`

## Coverage testing

coverage run --source=yamicache -p -m py.test && coverage combine && coverage report -m
17 changes: 17 additions & 0 deletions tests/test_exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import pytest
from yamicache.yamicache import Cache


def test_object_creation():
with pytest.raises(ValueError):
Cache(default_timeout=0.5)


def test_function():
c = Cache()

with pytest.raises(ValueError):

@c.cached(timeout=0.5)
def t1():
pass

0 comments on commit 94d549d

Please sign in to comment.