Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest #81

Merged
merged 1 commit into from
Feb 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ before_install:
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- conda update --yes --all
- travis_retry conda create --yes -n test python=$PYTHON --file requirements.txt
- source activate test
- travis_retry conda create --yes -n TEST python=$PYTHON --file requirements.txt
- source activate TEST
- travis_retry conda install --yes --file requirements-dev.txt
- if [[ "$PYTHON" != "3.5" ]]; then
travis_retry conda install --yes mock ;
fi
- travis_retry pip install

script:
- nosetests
- python setup.py test -a "--verbose"
- find . -type f -name "*.py" | xargs flake8 --max-line-length=100
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mock
nose
pytest
flake8
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
netCDF4 >=1.2.0
netCDF4 >=1.2.0,<1.2.2
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line did not work with early conda, but it is fine now!

Ping @kwilcox. You asked me recently about standardizing conda and pip requirements. I guess that conda can take pip syntax now as long as the package name is the same. (Both pip and conda are case insensitive BTW.)

numpy
20 changes: 19 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,23 @@
with_statement)

import os
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand


class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]

def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []

def run_tests(self):
# Import here, cause outside the eggs aren't loaded.
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)


def extract_version(module='pysgrid'):
Expand Down Expand Up @@ -36,7 +52,8 @@ def readme():
license='BSD',
long_description=readme(),
install_requires=reqs,
tests_require=['mock', 'nose'],
tests_require=['mock', 'nose', 'pytest'],
cmdclass=dict(test=PyTest),
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
Expand All @@ -47,4 +64,5 @@ def readme():
'Topic :: Scientific/Engineering',
],
include_package_data=True,
zip_safe=False
)