Changeset 6dba2f0 in sasmodels for conftest.py


Ignore:
Timestamp:
Jan 27, 2018 9:00:07 PM (7 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:
e59f60a
Parents:
2ab1bac
Message:

py.test needs kernelcl import to succeed even if pyopencl is not available

File:
1 edited

Legend:

Unmodified
Added
Removed
  • conftest.py

    r2ab1bac r6dba2f0  
    2020import pytest 
    2121from _pytest.unittest import TestCaseFunction 
    22  
    23 try: 
    24     # Ask OpenCL for the default context so that we know that one exists 
    25     import pyopencl as cl 
    26     cl.create_some_context(interactive=False) 
    27     TEST_PYOPENCL = True 
    28 except ImportError: 
    29     TEST_PYOPENCL = False 
    30  
    31 def pytest_ignore_collect(path, config): 
    32     ignore = TEST_PYOPENCL and path.basename == "kernelcl.py" 
    33     return ignore 
    3422 
    3523USE_DOCSTRING_AS_DESCRIPTION = True 
Note: See TracChangeset for help on using the changeset viewer.