Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 02939de

Browse files
committed
update infrastructure from nosetests to pytest, drop py2.7
1 parent 54016d9 commit 02939de

10 files changed

Lines changed: 26 additions & 71 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ src/*/tests/*.png
6666
src/*/tests/*.csv
6767
src/*/tests/*.tex
6868
src/*/tests/*.xlsx
69+
.cache
6970
.noseids
7071
.coverage
7172
wqio.egg-info

.travis.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,33 @@ language: python
22

33
matrix:
44
include:
5-
- python: 2.7
6-
env:
7-
- COVERAGE=false
85
- python: 3.4
96
env:
107
- COVERAGE=false
8+
- ARGS="--mpl --cov --verbose"
119
- python: 3.5
1210
env:
1311
- COVERAGE=true
12+
- ARGS="--mpl --cov --verbose"
1413

1514
before_install:
16-
17-
# Here we just install Miniconda, which you shouldn't have to change.
18-
1915
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
2016
- chmod +x miniconda.sh
2117
- ./miniconda.sh -b -p $HOME/miniconda
2218
- export PATH="$HOME/miniconda/bin:$PATH"
2319
- conda update --yes conda
24-
- cp wqio/data/matplotlibrc .
2520

2621
install:
27-
28-
# We just set up a conda environment with the right Python version. This
29-
# should not need changing.
30-
3122
- conda create --yes -n test python=$TRAVIS_PYTHON_VERSION
3223
- source activate test
33-
- conda install --yes matplotlib seaborn statsmodels numexpr openpyxl nose mock scipy
34-
- conda install --yes mpl-probscale --channel=phobson
35-
- conda install --yes coverage docopt requests pyyaml
24+
- conda install --yes matplotlib seaborn statsmodels numexpr openpyxl scipy=0.17.0
25+
- conda install --yes coverage docopt requests pyyaml pytest pytest-cov mock
26+
- conda install --yes mpl-probscale pytest-mpl --channel=conda-forge
3627
- pip install coveralls
3728
- pip install .
3829

3930
script:
40-
- python check_wqio.py --verbose --with-coverage --cover-package=wqio
31+
- python check_wqio.py ${ARGS}
4132

4233
after_success:
4334
- if [ ${COVERAGE} = true ]; then coveralls; fi

check_wqio.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import warnings
1+
import sys
22
import matplotlib
3-
import nose
4-
53
matplotlib.use('agg')
6-
nose.main()
4+
5+
import wqio
6+
status = wqio.test(*sys.argv[1:])
7+
sys.exit(status)

conda.recipes/dev/bld.bat

Lines changed: 0 additions & 8 deletions
This file was deleted.

conda.recipes/dev/build.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

conda.recipes/dev/meta.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ source:
99
# - fix.patch
1010

1111
build:
12+
script: python setup.py install
1213
number: 3
1314

1415
requirements:
@@ -40,14 +41,16 @@ requirements:
4041

4142
test:
4243
requires:
43-
- nose
44+
- pytest
45+
- pytest-cov
46+
- pytest-mpl
4447

4548
imports:
4649
- wqio
4750
- wqio.utils
4851

4952
commands:
50-
- python -c "import wqio; wqio.test()"
53+
- python -c "import matplotlib as mpl; mpl.use('agg'); import sys; import wqio; sys.exit(wqio.test())"
5154

5255
about:
5356
home: https://github.com/Geosyntec/wqio.git

conda.recipes/release/bld.bat

Lines changed: 0 additions & 8 deletions
This file was deleted.

conda.recipes/release/build.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

conda.recipes/release/meta.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ source:
1010
# - fix.patch
1111

1212
build:
13+
script: python setup.py install
1314
number: 2
1415

1516
requirements:
@@ -41,14 +42,16 @@ requirements:
4142

4243
test:
4344
requires:
44-
- nose
45+
- pytest
46+
- pytest-cov
47+
- pytest-mpl
4548

4649
imports:
4750
- wqio
4851
- wqio.utils
4952

5053
commands:
51-
- python -c "import wqio; wqio.test()"
54+
- python -c "import matplotlib as mpl; mpl.use('agg'); import sys; import wqio; sys.exit(wqio.test())"
5255

5356
about:
5457
home: https://github.com/Geosyntec/wqio.git

setup.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@
66
from setuptools import setup, find_packages
77

88

9-
def getDataFiles(submodule, folder):
10-
datadir = os.path.join('wqio', submodule, folder)
11-
files = [d for d in map(
12-
lambda x: os.path.join(datadir, x),
13-
os.listdir(datadir)
14-
)]
15-
return files
16-
17-
189
DESCRIPTION = "wqio: Water Quality Inflow/Outflow"
1910
LONG_DESCRIPTION = DESCRIPTION
2011
NAME = "wqio"
@@ -32,17 +23,16 @@ def getDataFiles(submodule, folder):
3223
"Programming Language :: Python",
3324
"Intended Audience :: Science/Research",
3425
"Topic :: Software Development :: Libraries :: Python Modules",
35-
'Programming Language :: Python :: 2.7',
3626
'Programming Language :: Python :: 3.4',
3727
'Programming Language :: Python :: 3.5',
3828
]
3929
INSTALL_REQUIRES = ['seaborn', 'probscale']
4030
PACKAGE_DATA = {
4131
'wqio.data': [ '*.csv', '*.tex', 'matplotlibrc', ],
42-
'wqio.tests.core_tests.baseline_images.core_tests.features_tests': ['*png'],
43-
'wqio.tests.core_tests.baseline_images.core_tests.hydro_tests': ['*png'],
44-
'wqio.tests.core_tests.baseline_images.core_tests.samples_tests': ['*png'],
45-
'wqio.tests.utils_tests.baseline_images.utils_tests.figutils_tests': ['*png'],
32+
'wqio.tests._baseline_images.core_tests.features_tests': ['*png'],
33+
'wqio.tests._baseline_images.core_tests.hydro_tests': ['*png'],
34+
'wqio.tests._baseline_images.core_tests.samples_tests': ['*png'],
35+
'wqio.tests._baseline_images.utils_tests.figutils_tests': ['*png'],
4636
}
4737

4838
setup(

0 commit comments

Comments
 (0)