forked from philhodge/stistools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconftest.py
49 lines (39 loc) · 1.07 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
"""Project default for pytest"""
import os
import pytest
from astropy.tests.helper import enable_deprecations_as_exceptions
# Uncomment the following line to treat all DeprecationWarnings as exceptions
enable_deprecations_as_exceptions()
def pytest_addoption(parser):
# Add option to run slow tests
parser.addoption(
"--runslow",
action="store_true",
help="run slow tests"
)
parser.addoption(
"--slow",
action="store_true",
help="run slow tests"
)
# Add option to use big data sets
parser.addoption(
"--bigdata",
action="store_true",
help="use big data sets (intranet)"
)
parser.addoption(
"--env",
choices=['dev', 'stable', ''],
default='',
help="specify what environment to test"
)
@pytest.fixture(scope='function', autouse=True)
def _jail(tmpdir):
""" Perform test in a pristine temporary working directory
"""
os.chdir(tmpdir.strpath)
yield
@pytest.fixture
def envopt(request):
return request.config.getoption("env")