Skip to content

Commit

Permalink
Treat Python's warnings as errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kentzo committed Oct 26, 2020
1 parent 7699d3a commit 4c7472f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ tests_require =
zipp==1.1.0; python_version >= "2.7" and python_version < "3.6"

[tool:pytest]
addopts= --cov=git_archive_all --cov-report=term --cov-branch --showlocals -vv
addopts = --cov=git_archive_all --cov-report=term --cov-branch --showlocals -vv
filterwarnings = error

[tox:tox]
envlist =
Expand Down
10 changes: 8 additions & 2 deletions test_git_archive_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from subprocess import check_call
import sys
from tarfile import TarFile, PAX_FORMAT
import warnings

import pycodestyle
import pytest
Expand Down Expand Up @@ -384,8 +385,13 @@ def test_ignore(contents, exclude, tmpdir, git_env, monkeypatch):
"""
Ensure that GitArchiver respects export-ignore.
"""
for name, value in git_env.items():
monkeypatch.setenv(name, value)

# On Python 2.7 contained code raises pytest.PytestWarning warning for no good reason.
with warnings.catch_warnings():
warnings.simplefilter("ignore")

for name, value in git_env.items():
monkeypatch.setenv(name, value)

repo_path = os_path_join(tmpdir.strpath, 'repo')
repo = Repo(repo_path)
Expand Down

0 comments on commit 4c7472f

Please sign in to comment.