Skip to content

Commit

Permalink
switch to py.test for collecting and executing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Hamman committed Oct 26, 2015
1 parent aca62ab commit 69878cf
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ install:
- python setup.py install

script:
- nosetests --with-coverage --cover-package xray
- py.test xray --cov=xray --cov-report term-missing

after_success:
- coveralls
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ install:
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""

# install xray and depenencies
- "conda install --yes --quiet pip nose numpy pandas scipy netCDF4 matplotlib dask"
- "conda install --yes --quiet pip pytest numpy pandas scipy netCDF4 matplotlib dask"
- "python setup.py install"

build: false

test_script:
- "nosetests xray"
- "py.test xray"
5 changes: 4 additions & 1 deletion ci/requirements-py26.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ dependencies:
- python=2.6.9
- cython=0.22.1
- h5py=2.5.0
- nose
- pytest
- ordereddict
- numpy=1.9.2
- pandas=0.16.2
- matplotlib=1.4
- openssl
- toolz
# no seaborn
- scipy=0.16.0
- unittest2
- pip:
- coveralls
- pytest-cov
- cyordereddict
- dask
- h5netcdf
3 changes: 2 additions & 1 deletion ci/requirements-py27-cdat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ dependencies:
- python=2.7
- cdat-lite
- dask
- nose
- pytest
- numpy
- pandas>=0.15.0
- scipy
- pip:
- coveralls
- pytest-cov
- cyordereddict
3 changes: 2 additions & 1 deletion ci/requirements-py27-min.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: test_env
dependencies:
- python=2.7
- nose
- pytest
- numpy==1.9.3
- pandas==0.15.0
- pip:
- coveralls
- pytest-cov
3 changes: 2 additions & 1 deletion ci/requirements-py27-netcdf4-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ dependencies:
- cython
- dask
- h5py
- nose
- pytest
- numpy
- pandas
- scipy
- pip:
- coveralls
- pytest-cov
- h5netcdf
- git+https://github.com/Unidata/netcdf4-python.git
3 changes: 2 additions & 1 deletion ci/requirements-py27-pydap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ dependencies:
- dask
- h5py
- netcdf4
- nose
- pytest
- numpy
- pandas
- scipy
- pip:
- coveralls
- pytest-cov
- pydap
3 changes: 2 additions & 1 deletion ci/requirements-py34.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: test_env
dependencies:
- python=3.4
- bottleneck
- nose
- pytest
- pandas
- pip:
- coveralls
- pytest-cov
3 changes: 2 additions & 1 deletion ci/requirements-py35-dask-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ name: test_env
dependencies:
- python=3.5
- cython
- nose
- pytest
- numpy
- pandas
- scipy
- toolz
- pip:
- coveralls
- pytest-cov
- git+https://github.com/blaze/dask.git
4 changes: 3 additions & 1 deletion ci/requirements-py35-pandas-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ name: test_env
dependencies:
- python=3.5
- cython=0.23.4
- nose
- pytest
- numpy=1.10.1
- netcdf4=1.1.9
- scipy=0.16.0
- toolz
- pip:
- coveralls
- pytest-cov
- dask
- git+https://github.com/pydata/pandas.git
3 changes: 2 additions & 1 deletion ci/requirements-py35.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ dependencies:
- h5py
- matplotlib
- netcdf4
- nose
- pytest
- numpy
- pandas
- seaborn
- scipy
- pip:
- coveralls
- pytest-cov
- h5netcdf
2 changes: 1 addition & 1 deletion doc/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ pandas) installed first. Then, install xray with pip::
$ pip install xray

To run the test suite after installing xray, install
`nose <https://nose.readthedocs.org>`__ and run ``nosetests xray``.
`py.test <https://pytest.org>`__ and run ``py.test xray``.
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[wheel]
universal = 1

[pytest]
python_files=test_*.py
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/usr/bin/env python
#!/usr/bin/env python
import os
import re
import sys
import warnings

from setuptools import setup, find_packages
from setuptools import Command

MAJOR = 0
MINOR = 6
Expand Down Expand Up @@ -36,7 +37,7 @@
]

INSTALL_REQUIRES = ['numpy >= 1.7', 'pandas >= 0.15.0']
TESTS_REQUIRE = ['nose >= 1.0']
TESTS_REQUIRE = ['pytest >= 2.7.1']

if sys.version_info[:2] < (2, 7):
TESTS_REQUIRE += ["unittest2 == 0.5.1"]
Expand Down Expand Up @@ -132,7 +133,6 @@ def write_version_py(filename=None):
if write_version:
write_version_py()


setup(name=DISTNAME,
version=FULLVERSION,
license=LICENSE,
Expand All @@ -144,6 +144,5 @@ def write_version_py(filename=None):
install_requires=INSTALL_REQUIRES,
tests_require=TESTS_REQUIRE,
url=URL,
test_suite='nose.collector',
packages=find_packages(),
package_data={'xray': ['test/data/*', 'plot/default_colormap.csv']})

0 comments on commit 69878cf

Please sign in to comment.