Skip to content

Commit

Permalink
CLN: Switch to pytest.mark.slow
Browse files Browse the repository at this point in the history
Consistently use pytest.mark.slow to indicate slow tests
  • Loading branch information
bashtage committed Aug 12, 2018
1 parent c9485a6 commit 0fc350d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
20 changes: 11 additions & 9 deletions statsmodels/emplike/tests/test_regression.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from __future__ import division

from numpy.testing import assert_almost_equal
from numpy.testing.decorators import slow

import pytest

from statsmodels.regression.linear_model import OLS
from statsmodels.tools import add_constant
from .results.el_results import RegressionResults
Expand Down Expand Up @@ -33,14 +35,14 @@ class TestRegressionPowell(GenRes):
"""

@slow
@pytest.mark.slow
def test_hypothesis_beta0(self):
beta0res = self.res1.el_test([-30], [0], return_weights=1,
method='powell')
assert_almost_equal(beta0res[:2], self.res2.test_beta0[:2], 4)
assert_almost_equal(beta0res[2], self.res2.test_beta0[2], 4)

@slow
@pytest.mark.slow
def test_hypothesis_beta1(self):
beta1res = self.res1.el_test([.5], [1], return_weights=1,
method='powell')
Expand Down Expand Up @@ -106,14 +108,14 @@ def test_hypothesis_beta1(self):
assert_almost_equal(beta1res[:2], self.res2.test_beta1[:2], 4)
assert_almost_equal(beta1res[2], self.res2.test_beta1[2], 4)

@slow
@pytest.mark.slow
def test_hypothesis_beta2(self):
beta2res = self.res1.el_test([1], [2], return_weights=1,
method='nm')
assert_almost_equal(beta2res[:2], self.res2.test_beta2[:2], 4)
assert_almost_equal(beta2res[2], self.res2.test_beta2[2], 4)

@slow
@pytest.mark.slow
def test_hypothesis_beta3(self):
beta3res = self.res1.el_test([0], [3], return_weights=1,
method='nm')
Expand All @@ -122,7 +124,7 @@ def test_hypothesis_beta3(self):

# Confidence interval results obtained through hyp testing in Matlab

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

@slow
@pytest.mark.slow
def test_ci_beta1(self):
beta1ci = self.res1.conf_int_el(1, method='nm')
assert_almost_equal(beta1ci, self.res2.test_ci_beta1, 6)

@slow
@pytest.mark.slow
def test_ci_beta2(self):
beta2ci = self.res1.conf_int_el(2, lower_bound=.59, upper_bound=2.2, method='nm')
assert_almost_equal(beta2ci, self.res2.test_ci_beta2, 6)

@slow
@pytest.mark.slow
def test_ci_beta3(self):
beta3ci = self.res1.conf_int_el(3, method='nm')
assert_almost_equal(beta3ci, self.res2.test_ci_beta3, 6)
7 changes: 4 additions & 3 deletions statsmodels/stats/tests/test_knockoff.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
import pytest

from statsmodels.stats import knockoff_regeffects as kr
from statsmodels.stats._knockoff import (RegressionFDR,
_design_knockoff_equi,
_design_knockoff_sdp)
from numpy.testing import assert_allclose, assert_array_equal
from numpy.testing.decorators import slow

try:
import cvxopt
Expand Down Expand Up @@ -81,7 +82,7 @@ def test_testers():
RegressionFDR(y, x, tv, design_method=method)


@slow
@pytest.mark.slow
def test_sim():
# This function assesses the performance of the knockoff approach
# relative to its theoretical claims.
Expand Down

0 comments on commit 0fc350d

Please sign in to comment.