Skip to content

Commit cd45ff6

Browse files
committed
CLN: proper version checking for statsmodels testWLS
1 parent c583493 commit cd45ff6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

doc/source/release.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ Improvements to existing features
128128
- ``read_stata`` now accepts Stata 13 format (:issue:`4291`)
129129
- ``ExcelWriter`` and ``ExcelFile`` can be used as contextmanagers.
130130
(:issue:`3441`, :issue:`4933`)
131+
- ``pandas`` is now tested with two different versions of ``statsmodels``
132+
(0.4.3 and 0.5.0) (:issue:`4981`).
131133

132134
API Changes
133135
~~~~~~~~~~~

pandas/stats/tests/test_ols.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from __future__ import division
88

9+
from distutils.version import LooseVersion
910
from datetime import datetime
1011
from pandas import compat
1112
import unittest
@@ -98,11 +99,10 @@ def testOLSWithDatasets_scotland(self):
9899

99100
def testWLS(self):
100101
# WLS centered SS changed (fixed) in 0.5.0
101-
v = sm.version.version.split('.')
102-
if int(v[0]) >= 0 and int(v[1]) <= 5:
103-
if int(v[2]) < 1:
104-
raise nose.SkipTest
105-
print( "Make sure you're using statsmodels 0.5.0.dev-cec4f26 or later.")
102+
sm_version = sm.version.version
103+
if sm_version < LooseVersion('0.5.0'):
104+
raise nose.SkipTest("WLS centered SS not fixed in statsmodels"
105+
" version {0}".format(sm_version))
106106

107107
X = DataFrame(np.random.randn(30, 4), columns=['A', 'B', 'C', 'D'])
108108
Y = Series(np.random.randn(30))

0 commit comments

Comments
 (0)