Skip to content

Commit 50231d9

Browse files
committed
get up to date with coverage and pep8
1 parent 54d2c6a commit 50231d9

File tree

9 files changed

+109
-107
lines changed

9 files changed

+109
-107
lines changed

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ matrix:
55
- python: 2.7
66
env:
77
- COVERAGE=false
8-
- TESTERS="conda-forge pytest mock pytest-mpl coverage"
8+
- EXTRATESTERS="mock"
99
- ARGS="--verbose"
1010
- python: 3.4
1111
env:
1212
- COVERAGE=false
13-
- TESTERS="conda-forge pytest pytest-mpl coverage"
13+
- EXTRATESTERS=""
1414
- ARGS="--mpl --verbose"
1515
- python: 3.5
1616
env:
1717
- COVERAGE=false
18-
- TESTERS="conda-forge pytest pytest-mpl coverage"
18+
- EXTRATESTERS=""
1919
- ARGS="--mpl --verbose"
2020
- python: 3.5
2121
env:
2222
- COVERAGE=true
23-
- TESTERS="conda-forge pytest pytest-mpl coverage"
24-
- ARGS="--mpl --verbose"
23+
- EXTRATESTERS=""
24+
- ARGS="--mpl --verbose --pep8"
2525

2626
before_install:
2727

@@ -41,7 +41,7 @@ install:
4141

4242
- conda create --yes -n test python=$TRAVIS_PYTHON_VERSION numpy matplotlib docopt requests pyyaml
4343
- source activate test
44-
- conda install --yes --channel=${TESTERS}
44+
- conda install --yes --channel=conda-forge pytest-mpl pytest-cov pytest-pep8 ${EXTRATESTERS}
4545
- if [ ${COVERAGE} = true ]; then conda install scipy --yes; fi
4646
- pip install codecov
4747
- pip install .

docs/readme.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.. include:: ../README.rst
1+
.. include:: ../README.md

probscale/tests/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
import probscale
66

7+
78
def test(*args):
89
options = [resource_filename('probscale', 'tests')]
910
options.extend(list(args))
10-
return pytest.main(options)
11+
return pytest.main(options)

probscale/tests/test_formatters.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
from probscale import formatters
77

88

9-
@pytest.mark.parametrize("fmtr", [formatters.PctFormatter, formatters.ProbFormatter])
9+
@pytest.mark.parametrize("fmtr", [
10+
formatters.PctFormatter,
11+
formatters.ProbFormatter
12+
])
1013
def test_base_class_of_formatter(fmtr):
1114
assert issubclass(fmtr, formatters._FormatterMixin)
1215

probscale/tests/test_probscale.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ def test_minimal_norm__approx_inv_erf(mn, mn_input):
5858

5959
def test_minimal_norm_ppf(mn, mn_input):
6060
known_ppf = numpy.array([
61-
-0.43715354, 0.6495236 , -1.49851307, 0.93847570,
61+
-0.43715354, 0.64952360, -1.49851307, 0.93847570,
6262
-0.36648929, -1.34693863, 0.68713129, -0.40701088,
63-
0.71275076, 0.40701088, -0.70952297, 1.34075503,
63+
+0.71275076, 0.40701088, -0.70952297, 1.34075503,
6464
])
6565
diff = mn.ppf(mn_input) - known_ppf
6666
assert numpy.all(numpy.abs(diff) < 0.001)

probscale/tests/test_transforms.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88

99

1010
def test__mask_out_of_bounds():
11-
known = numpy.array([numpy.nan, numpy.nan, 0.1, 0.5, 0.9, numpy.nan, numpy.nan])
11+
known = numpy.array([
12+
numpy.nan, numpy.nan, 0.1, 0.5,
13+
0.9, numpy.nan, numpy.nan
14+
])
1215
x = [-0.1, 0, 0.1, 0.5, 0.9, 1.0, 1.1]
1316
result = transforms._mask_out_of_bounds(x)
1417
nptest.assert_array_equal(known, result)
@@ -22,7 +25,6 @@ def test__clip_out_of_bounds():
2225
assert numpy.all(diff < 0.0001)
2326

2427

25-
2628
@pytest.fixture
2729
def prob_trans():
2830
cls = transforms.ProbTransform
@@ -80,13 +82,19 @@ def test_transform_inverted(trans, inver_cls):
8082
assert trans.out_of_bounds == t_inv.out_of_bounds
8183

8284

83-
@pytest.mark.parametrize('cls', [transforms.ProbTransform, transforms.QuantileTransform])
85+
@pytest.mark.parametrize('cls', [
86+
transforms.ProbTransform,
87+
transforms.QuantileTransform
88+
])
8489
def test_bad_out_of_bounds(cls):
8590
with pytest.raises(ValueError):
8691
cls(_minimal_norm, out_of_bounds='junk')
8792

8893

89-
@pytest.mark.parametrize('cls', [transforms.ProbTransform, transforms.QuantileTransform])
94+
@pytest.mark.parametrize('cls', [
95+
transforms.ProbTransform,
96+
transforms.QuantileTransform
97+
])
9098
@pytest.mark.parametrize(('method', 'func'), [
9199
('clip', transforms._clip_out_of_bounds),
92100
('mask', transforms._mask_out_of_bounds),

probscale/tests/test_validate.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from probscale import validate
66

7+
78
def test_axes_object_invalid():
89
with pytest.raises(ValueError):
910
validate.axes_object('junk')

0 commit comments

Comments
 (0)