Skip to content

Commit

Permalink
Add coverage (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
retr0h authored Mar 14, 2020
1 parent d39d90e commit 7c1dc9c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .coveragerc

This file was deleted.

2 changes: 0 additions & 2 deletions pytest.ini

This file was deleted.

2 changes: 2 additions & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ def random_string(len=5):

@pytest.fixture()
def temp_dir(tmpdir, request):
_cwd = os.getcwd()
d = tmpdir.mkdir(random_string())
os.chdir(d.strpath)

def cleanup():
shutil.rmtree(d.strpath)
os.chdir(_cwd)

request.addfinalizer(cleanup)

Expand Down
11 changes: 11 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ passenv = *
commands =
unit: py.test --runslow -vv {posargs}
lint: flake8
setenv =
COVERAGE_FILE={toxworkdir}/.coverage
extras =
test

Expand Down Expand Up @@ -77,3 +79,12 @@ exclude =
#- [H203] Use assertIs(Not)None to check for None.
#- [H904] Delay string interpolations at logging calls.
enable-extensions = H106,H203,H904

[pytest]
testpaths = test/
addopts = -v -rxXs --doctest-modules --cov gilt --cov-report term-missing --showlocals
norecursedirs = dist doc build .tox .eggs

[coverage:report]
fail_under =
95

0 comments on commit 7c1dc9c

Please sign in to comment.