-
Notifications
You must be signed in to change notification settings - Fork 107
/
Copy pathconftest.py
61 lines (45 loc) · 1.92 KB
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Copyright 2014-2016 The ODL development group
#
# This file is part of ODL.
#
# ODL is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ODL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ODL. If not, see <http://www.gnu.org/licenses/>.
"""Test configuration file."""
from __future__ import print_function, division, absolute_import
from future import standard_library
standard_library.install_aliases()
import pytest
import odl
from odl.space.cu_ntuples import CUDA_AVAILABLE
from odl.trafos.wavelet import PYWAVELETS_AVAILABLE
collect_ignore = ['setup.py', 'run_tests.py']
if not CUDA_AVAILABLE:
collect_ignore.append('odl/space/cu_ntuples.py')
if not PYWAVELETS_AVAILABLE:
collect_ignore.append('odl/trafos/wavelet.py')
def pytest_addoption(parser):
parser.addoption('--largescale', action='store_true',
help='Run large and slow tests')
parser.addoption('--benchmark', action='store_true',
help='Run benchmarks')
# reusable fixtures
ufunc_params = [ufunc for ufunc in odl.util.ufuncs.UFUNCS]
ufunc_ids = [' ufunc={} '.format(p[0]) for p in ufunc_params]
@pytest.fixture(scope="module", ids=ufunc_ids, params=ufunc_params)
def ufunc(request):
return request.param
reduction_params = [reduction for reduction in odl.util.ufuncs.REDUCTIONS]
reduction_ids = [' reduction={} '.format(p[0]) for p in reduction_params]
@pytest.fixture(scope="module", ids=reduction_ids, params=reduction_params)
def reduction(request):
return request.param