Changeset bb4ff2a in sasmodels for conftest.py


Ignore:
Timestamp:
Jan 26, 2018 8:45:35 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:
42158d2
Parents:
ecb485c
Message:

work around travis/appveyor limitations for pytest

File:
1 edited

Legend:

Unmodified
Added
Removed
  • conftest.py

    ra69d8cd rbb4ff2a  
    1111test specifically from the py.test command line. [This is perhaps because 
    1212the modifyitems hook is only called after test selection.] 
     13 
     14*pytest_ignore_collect* skips kernelcl.py if pyopencl cannot be imported. 
    1315""" 
    1416from __future__ import print_function 
    1517 
     18import os.path 
     19 
    1620import pytest 
    1721from _pytest.unittest import TestCaseFunction 
     22 
     23try: 
     24    import pyopencl 
     25    TEST_PYOPENCL = True 
     26except ImportError: 
     27    TEST_PYOPENCL = False 
     28 
     29def pytest_ignore_collect(path, config): 
     30    ignore = TEST_PYOPENCL and path.basename == "kernelcl.py" 
     31    return ignore 
    1832 
    1933USE_DOCSTRING_AS_DESCRIPTION = True 
Note: See TracChangeset for help on using the changeset viewer.