diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index d915df6..0000000 --- a/.coveragerc +++ /dev/null @@ -1,3 +0,0 @@ -[report] -fail_under = - 95 diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 5768a68..0000000 --- a/pytest.ini +++ /dev/null @@ -1,2 +0,0 @@ -[pytest] -testpaths = test/ diff --git a/test/conftest.py b/test/conftest.py index 53988ed..f2a5411 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -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) diff --git a/tox.ini b/tox.ini index c1cea73..1541115 100644 --- a/tox.ini +++ b/tox.ini @@ -16,6 +16,8 @@ passenv = * commands = unit: py.test --runslow -vv {posargs} lint: flake8 +setenv = + COVERAGE_FILE={toxworkdir}/.coverage extras = test @@ -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