Skip to content

Commit cb11c33

Browse files
authored
Merge pull request #78 from phobson/follow-linter
take the linter's advice
2 parents 99f1b98 + a3134fc commit cb11c33

8 files changed

+8
-22
lines changed

check_probscale.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
import sys
2-
import matplotlib
3-
4-
matplotlib.use("agg")
5-
6-
from matplotlib.pyplot import style
7-
8-
style.use("classic")
92

103
from probscale import tests
114

5+
126
status = tests.test(*sys.argv[1:])
137
sys.exit(status)

probscale/tests/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
def test(*args):
77
try:
88
import pytest
9-
except ImportError as e:
9+
except ImportError:
1010
raise ImportError("`pytest` is required to run the test suite")
1111

1212
options = [resource_filename("probscale", "tests")]

probscale/tests/test_formatters.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import numpy
22

33
import pytest
4-
import numpy.testing as nptest
54

65
from probscale import formatters
76

probscale/tests/test_probscale.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import os
2-
import sys
32

43
import numpy
54
import matplotlib.pyplot as plt
65

76
try:
87
from scipy import stats
9-
except: # pragma: no cover
8+
except ImportError: # pragma: no cover
109
stats = None
1110

1211
import pytest
@@ -127,7 +126,7 @@ def test_sign_with_nan_no_warning(mn):
127126
assert numpy.isnan(res)
128127

129128

130-
def test_sign_with_nan_no_warning(mn):
129+
def test_sign_with_nan_no_warning_inv(mn):
131130
with pytest.warns(None) as record:
132131
res = mn._approx_inv_erf(numpy.nan)
133132
assert not record

probscale/tests/test_validate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_fit_arguments_valid(which, kwarg):
4343
assert result == which
4444

4545

46-
@pytest.mark.parametrize(("kwarg",), [("fitprobs",), ("fitlogs",),])
46+
@pytest.mark.parametrize("kwarg", ["fitprobs", "fitlogs"])
4747
def test_fit_arguments_invalid(kwarg):
4848
with pytest.raises(ValueError):
4949
validate.fit_argument("junk", kwarg)

probscale/tests/test_viz.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
import sys
2-
from functools import wraps
3-
41
import numpy
52
import matplotlib.lines
63
import matplotlib.pyplot as plt
74

85
try:
96
from scipy import stats
10-
except: # pragma: no cover
7+
except ImportError: # pragma: no cover
118
stats = None
129

1310
try:
1411
import seaborn
15-
except: # pragma: no cover
12+
except ImportError: # pragma: no cover
1613
seaborn = None
1714

1815
from probscale import viz
@@ -1075,6 +1072,6 @@ def test_probplot_with_FacetGrid_with_markers(usemarkers):
10751072
_lines = filter(
10761073
lambda x: isinstance(x, matplotlib.lines.Line2D), fg.ax.get_children()
10771074
)
1078-
result_markers = {l.get_label(): l.get_marker() for l in _lines}
1075+
result_markers = {line.get_label(): line.get_marker() for line in _lines}
10791076
expected_markers = dict(zip(species, markers))
10801077
assert expected_markers == result_markers

probscale/viz.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import copy
22

33
import numpy
4-
from matplotlib import pyplot
54

65
from .probscale import _minimal_norm
76
from . import validate

setup.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#
33
# Usage: python setup.py install
44

5-
6-
import os
75
from setuptools import setup, find_packages
86

97

0 commit comments

Comments
 (0)