'This returns a class which doesn\'t inherient from fitter'

def test_bad_class(self):

    with warnings.catch_warnings():
        warnings.filterwarnings(u'error')
        try:
            mock_entry_badclass = mock.create_autospec(EntryPoint)
            mock_entry_badclass.name = u'BadClass'
            mock_entry_badclass.load = self.returnbadclass
            populate_entry_points([mock_entry_badclass])
        except AstropyUserWarning as w:
            if (u'modeling.Fitter' in w.args[0]):
                pass
            else:
                raise w
        else:
            raise self.exception_not_thrown
