Skip to content

Commit

Permalink
TST: Switch form skip to smoke
Browse files Browse the repository at this point in the history
Treat test as a smoke test on Python 2.7 instead of skipping
  • Loading branch information
bashtage committed Aug 12, 2018
1 parent 39a6926 commit 09018b9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions statsmodels/genmod/tests/test_glm_weights.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,6 @@ def setup_class(cls):
cls.res2 = mod2.fit()


@pytest.mark.skipif(not PY3, reason='pytest warning capture does is buggy on 2.x')
def test_warnings_raised():
weights = [1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3, 3]
# faking aweights by using normalized freq_weights
Expand All @@ -776,13 +775,15 @@ def test_warnings_raised():

cov_kwds = {'groups': gid, 'use_correction': False}

with pytest.warns(SpecificationWarning):
# Work around for buggy pytest repeated warning capture on Python 2.7
warning_type = SpecificationWarning if PY3 else None
with pytest.warns(warning_type):
res1 = GLM(cpunish_data.endog, cpunish_data.exog,
family=sm.families.Poisson(), freq_weights=weights
).fit(cov_type='cluster', cov_kwds=cov_kwds)
res1.summary()

with pytest.warns(SpecificationWarning):
with pytest.warns(warning_type):
res1 = GLM(cpunish_data.endog, cpunish_data.exog,
family=sm.families.Poisson(), var_weights=weights
).fit(cov_type='cluster', cov_kwds=cov_kwds)
Expand Down

0 comments on commit 09018b9

Please sign in to comment.