forked from dials/dials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconftest.py
40 lines (34 loc) · 1.32 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
#
# See https://github.com/dials/dials/wiki/pytest for documentation on how to
# write and run pytest tests, and an overview of the available features.
#
from __future__ import absolute_import, division, print_function
import libtbx.load_env
import os
import pytest
@pytest.fixture
def dials_regression():
'''Return the absolute path to the dials_regression module as a string.
Skip the test if dials_regression is not installed.'''
try:
return libtbx.env.dist_path('dials_regression')
except KeyError:
pytest.skip("dials_regression required for this test")
@pytest.fixture
def xia2_regression():
'''Return the absolute path to the xia2_regression module as a string.
Skip the test if dials_regression is not installed.'''
try:
return libtbx.env.dist_path('xia2_regression')
except KeyError:
pytest.skip("xia2_regression required for this test")
@pytest.fixture
def xia2_regression_build():
'''Return the absolute path to the xia2_regression directory within the build
path as a string. Skip the test if xia2_regression is not installed.'''
x2rpath = libtbx.env.under_build('xia2_regression')
if not os.path.exists(x2rpath):
pytest.skip("xia2_regression required for this test")
return x2rpath
from libtbx.test_utils.pytest import libtbx_collector
pytest_collect_file = libtbx_collector()