Skip to content

Commit

Permalink
DEP: Add test for deprecated module
Browse files Browse the repository at this point in the history
Add test for deprecated module
  • Loading branch information
bashtage committed Jul 30, 2017
1 parent ee60326 commit 02dcbf6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion arch/bootstrap/multiple_comparrison.py
Expand Up @@ -3,6 +3,7 @@

# Remove after October 2017
warnings.warn('Misspelled module deprecated. Use '
'arch.bootstrap.multiple_comparison instead', DeprecationWarning)
'arch.bootstrap.multiple_comparison instead', DeprecationWarning,
stacklevel=2)

__all__ = ['StepM', 'SPA', 'RealityCheck']
12 changes: 7 additions & 5 deletions arch/tests/bootstrap/test_multiple_comparison.py
@@ -1,7 +1,5 @@
from __future__ import absolute_import, division

from unittest import TestCase

import numpy as np
from numpy import random, linspace
from numpy.testing import assert_equal, assert_allclose
Expand All @@ -15,7 +13,7 @@
from arch.bootstrap.multiple_comparison import SPA, StepM, MCS


class TestSPA(TestCase):
class TestSPA(object):
@classmethod
def setup_class(cls):
random.seed(23456)
Expand Down Expand Up @@ -172,7 +170,7 @@ def test_single_model(self):
spa.compute()


class TestStepM(TestCase):
class TestStepM(object):
@classmethod
def setup_class(cls):
random.seed(23456)
Expand Down Expand Up @@ -272,7 +270,7 @@ def test_exact_ties(self):
assert_equal(len(stepm.superior_models), self.models.shape[1] - 2)


class TestMCS(TestCase):
class TestMCS(object):
@classmethod
def setup_class(cls):
random.seed(23456)
Expand Down Expand Up @@ -438,3 +436,7 @@ def test_missing_included_max(self):
mcs.compute()
assert len(mcs.included) > 0
assert (len(mcs.included) + len(mcs.excluded)) == 20

def test_warning_misspelled(self):
with pytest.deprecated_call():
import arch.bootstrap.multiple_comparrison # flake8: noqa

0 comments on commit 02dcbf6

Please sign in to comment.