Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0fc350d

Browse files
committedAug 12, 2018
CLN: Switch to pytest.mark.slow
Consistently use pytest.mark.slow to indicate slow tests
1 parent c9485a6 commit 0fc350d

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed
 

‎statsmodels/emplike/tests/test_regression.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from __future__ import division
22

33
from numpy.testing import assert_almost_equal
4-
from numpy.testing.decorators import slow
4+
5+
import pytest
6+
57
from statsmodels.regression.linear_model import OLS
68
from statsmodels.tools import add_constant
79
from .results.el_results import RegressionResults
@@ -33,14 +35,14 @@ class TestRegressionPowell(GenRes):
3335
3436
"""
3537

36-
@slow
38+
@pytest.mark.slow
3739
def test_hypothesis_beta0(self):
3840
beta0res = self.res1.el_test([-30], [0], return_weights=1,
3941
method='powell')
4042
assert_almost_equal(beta0res[:2], self.res2.test_beta0[:2], 4)
4143
assert_almost_equal(beta0res[2], self.res2.test_beta0[2], 4)
4244

43-
@slow
45+
@pytest.mark.slow
4446
def test_hypothesis_beta1(self):
4547
beta1res = self.res1.el_test([.5], [1], return_weights=1,
4648
method='powell')
@@ -106,14 +108,14 @@ def test_hypothesis_beta1(self):
106108
assert_almost_equal(beta1res[:2], self.res2.test_beta1[:2], 4)
107109
assert_almost_equal(beta1res[2], self.res2.test_beta1[2], 4)
108110

109-
@slow
111+
@pytest.mark.slow
110112
def test_hypothesis_beta2(self):
111113
beta2res = self.res1.el_test([1], [2], return_weights=1,
112114
method='nm')
113115
assert_almost_equal(beta2res[:2], self.res2.test_beta2[:2], 4)
114116
assert_almost_equal(beta2res[2], self.res2.test_beta2[2], 4)
115117

116-
@slow
118+
@pytest.mark.slow
117119
def test_hypothesis_beta3(self):
118120
beta3res = self.res1.el_test([0], [3], return_weights=1,
119121
method='nm')
@@ -122,7 +124,7 @@ def test_hypothesis_beta3(self):
122124

123125
# Confidence interval results obtained through hyp testing in Matlab
124126

125-
@slow
127+
@pytest.mark.slow
126128
def test_ci_beta0(self):
127129
# All confidence intervals are tested by conducting a hypothesis
128130
# tests at the confidence interval values since el_test
@@ -136,17 +138,17 @@ def test_ci_beta0(self):
136138
beta0ci = self.res1.conf_int_el(0, method='nm')
137139
assert_almost_equal(beta0ci, self.res2.test_ci_beta0, 6)
138140

139-
@slow
141+
@pytest.mark.slow
140142
def test_ci_beta1(self):
141143
beta1ci = self.res1.conf_int_el(1, method='nm')
142144
assert_almost_equal(beta1ci, self.res2.test_ci_beta1, 6)
143145

144-
@slow
146+
@pytest.mark.slow
145147
def test_ci_beta2(self):
146148
beta2ci = self.res1.conf_int_el(2, lower_bound=.59, upper_bound=2.2, method='nm')
147149
assert_almost_equal(beta2ci, self.res2.test_ci_beta2, 6)
148150

149-
@slow
151+
@pytest.mark.slow
150152
def test_ci_beta3(self):
151153
beta3ci = self.res1.conf_int_el(3, method='nm')
152154
assert_almost_equal(beta3ci, self.res2.test_ci_beta3, 6)

‎statsmodels/stats/tests/test_knockoff.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import numpy as np
2+
from numpy.testing import assert_allclose, assert_array_equal
3+
import pytest
4+
25
from statsmodels.stats import knockoff_regeffects as kr
36
from statsmodels.stats._knockoff import (RegressionFDR,
47
_design_knockoff_equi,
58
_design_knockoff_sdp)
6-
from numpy.testing import assert_allclose, assert_array_equal
7-
from numpy.testing.decorators import slow
89

910
try:
1011
import cvxopt
@@ -81,7 +82,7 @@ def test_testers():
8182
RegressionFDR(y, x, tv, design_method=method)
8283

8384

84-
@slow
85+
@pytest.mark.slow
8586
def test_sim():
8687
# This function assesses the performance of the knockoff approach
8788
# relative to its theoretical claims.

0 commit comments

Comments
 (0)
Please sign in to comment.