forked from sktime/sktime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conftest.py
38 lines (31 loc) · 1.34 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
# -*- coding: utf-8 -*-
"""Main configuration file for pytest.
Contents:
adds a --matrixdesign option to pytest
this allows to turn on/off the sub-sampling in the tests (for shorter runtime)
"on" condition is partition/block design to ensure each estimator full tests are run
on each operating system at least once, and on each python version at least once,
but not necessarily on each operating system / python version combination
by default, this is off, including for default local runs of pytest
"""
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
__author__ = ["fkiraly"]
def pytest_addoption(parser):
"""Pytest command line parser options adder."""
parser.addoption(
"--matrixdesign",
default=False,
help="sub-sample estimators in tests by os/version matrix partition design",
)
parser.addoption(
"--only_cython_estimators",
default=False,
help="test only cython estimators, with tag requires_cython=True",
)
def pytest_configure(config):
"""Pytest configuration preamble."""
from sktime.tests import test_all_estimators
if config.getoption("--matrixdesign") in [True, "True"]:
test_all_estimators.MATRIXDESIGN = True
if config.getoption("--only_cython_estimators") in [True, "True"]:
test_all_estimators.CYTHON_ESTIMATORS = True