Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMPAT: Fix failing test on Python 2.6 #1551

Merged
merged 2 commits into from Apr 4, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 5 additions & 13 deletions statsmodels/stats/tests/test_pairwise.py
Expand Up @@ -8,8 +8,7 @@

from statsmodels.compatnp.py3k import BytesIO, asbytes
import numpy as np
from numpy.testing import assert_almost_equal, assert_equal
from unittest import TestCase
from numpy.testing import assert_almost_equal, assert_equal, assert_

from statsmodels.stats.libqsturng import qsturng

Expand Down Expand Up @@ -179,7 +178,7 @@ def test_shortcut_function(self):
assert_almost_equal(res.confint, self.res.confint, decimal=14)


class TestTuckeyHSD2(CheckTuckeyHSDMixin, TestCase):
class TestTuckeyHSD2(CheckTuckeyHSDMixin):

@classmethod
def setup_class(self):
Expand Down Expand Up @@ -209,30 +208,23 @@ def test_table_names_default_group_order(self):
for i in range(1, 4):
first_group = t[i][0].data
second_group = t[i][1].data
self.assertTupleEqual(
(first_group, second_group),
expected_order[i - 1]
)
assert_((first_group, second_group) == expected_order[i - 1])

def test_table_names_custom_group_order(self):
# if the group_order parameter is used, the groups should
# be reported in the specified order
mc = MultiComparison(self.endog, self.groups,
group_order=[b'physical', b'medical', b'mental'])
res = mc.tukeyhsd(alpha=self.alpha)
print(res)
#print(res)
t = res._results_table
expected_order = [(b'physical',b'medical'),
(b'physical',b'mental'),
(b'medical', b'mental')]
for i in range(1, 4):
first_group = t[i][0].data
second_group = t[i][1].data
self.assertTupleEqual(
(first_group, second_group),
expected_order[i - 1]
)

assert_((first_group, second_group) == expected_order[i - 1])


class TestTuckeyHSD2s(CheckTuckeyHSDMixin):
Expand Down