Changeset 1f991d6 in sasmodels


Ignore:
Timestamp:
Jan 27, 2018 4:57:31 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
2ab1bac
Parents:
42158d2
Message:

add 'test' target to setup.py

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • .travis.yml

    r42158d2 r1f991d6  
    3838- conda info -a 
    3939# 2018-01-26 PAK: sasmodels uses yield generator for tests, which isn't supported in pytest 4+ 
    40 - conda install --yes python=$PY numpy scipy cython mako docutils cffi "pytest<4" 
     40- conda install --yes python=$PY numpy scipy cython mako docutils cffi setuptools "pytest<4" 
    4141install: 
    4242- pip install bumps 
     
    4545- python --version 
    4646#- python -m sasmodels.model_test -v dll all 
    47 - python -m pytest -v --cache-clear 
     47#- python -m pytest -v --cache-clear 
     48- python setup.py test --pytest-args -v 
    4849before_deploy: 
    4950- echo -e "Host danse.chem.utk.edu\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config 
  • appveyor.yml

    r42158d2 r1f991d6  
    6969    # 2018-01-19 PAK: skipping toolchain cython and cffi (these were for pyopencl?) 
    7070    # 2018-01-26 PAK: sasmodels uses yield generator for tests, which isn't supported in pytest 4+ 
    71     - cmd: conda install --yes --quiet numpy scipy docutils "pytest<4" 
     71    - cmd: conda install --yes --quiet numpy scipy docutils setuptools "pytest<4" 
    7272    # 2018-01-19 PAK: skipping pyopencl; this would be needed for deploy but maybe not for test 
    7373    #- cmd: conda install --yes --channel conda-forge pyopencl 
     
    8989    #- python -m sasmodels.model_test dll all 
    9090    #- nosetests -v sasmodels/*.py 
    91     - python -m pytest -v --cache-clear 
     91    #- python -m pytest -v --cache-clear 
     92    - python setup.py test --pytest-args -v 
  • setup.py

    r32e3c9b r1f991d6  
    1 try: 
    2     from setuptools import setup 
    3 except ImportError: 
    4     from distutils.core import setup 
     1import sys 
     2from setuptools import setup 
     3from setuptools.command.test import test as TestCommand 
     4 
     5class PyTest(TestCommand): 
     6    user_options = [('pytest-args=', 'a', "Arguments to pass to pytest")] 
     7 
     8    def initialize_options(self): 
     9        TestCommand.initialize_options(self) 
     10        self.pytest_args = '' 
     11 
     12    def run_tests(self): 
     13        import shlex 
     14        #import here, cause outside the eggs aren't loaded 
     15        import pytest 
     16        errno = pytest.main(shlex.split(self.pytest_args)) 
     17        sys.exit(errno) 
    518 
    619def find_version(package): 
     
    4861        'sasmodels': ['*.c', '*.cl'], 
    4962    }, 
    50     install_requires = [ 
     63    install_requires=[ 
    5164    ], 
    52     extras_require = { 
     65    extras_require={ 
    5366        'OpenCL': ["pyopencl"], 
    5467        'Bumps': ["bumps"], 
    5568        'TinyCC': ["tinycc"], 
    5669    }, 
     70    build_requires=['setuptools'], 
     71    test_requires=['pytest'], 
     72    cmdclass = {'test': PyTest}, 
    5773) 
Note: See TracChangeset for help on using the changeset viewer.