Skip to content

Instantly share code, notes, and snippets.

@abhijeetpanda12
Last active March 5, 2018 14:41
Show Gist options
  • Save abhijeetpanda12/3017daed56e47a18b300ab18c89e756e to your computer and use it in GitHub Desktop.
Save abhijeetpanda12/3017daed56e47a18b300ab18c89e756e to your computer and use it in GitHub Desktop.
tukey plot_simultaneous() smoke test for statsmodels/stats/tests/test_pairwise.py
try:
import matplotlib.pyplot as plt # makes plt available for test functions
have_matplotlib = True
except ImportError:
have_matplotlib = False
class CheckTuckeyHSDMixin(object):
@classmethod
def setup_class_(cls):
cls.mc = MultiComparison(cls.endog, cls.groups)
cls.res = cls.mc.tukeyhsd(alpha=cls.alpha)
@skipif(not have_matplotlib, reason='matplotlib not available')
def test_plot_simultaneous(self):
result = pairwise_tukeyhsd(self.endog, self.groups, alpha=self.alpha)
# Smoke test for figure
fig = result.plot_simultaneous()
assert_equal(isinstance(fig, plt.Figure), True)
plt.close(fig)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment