'This returns a function which fails the type check'

def test_bad_func(self):

    with warnings.catch_warnings():
        warnings.filterwarnings(u'error')
        try:
            mock_entry_badfunc = mock.create_autospec(EntryPoint)
            mock_entry_badfunc.name = u'BadFunc'
            mock_entry_badfunc.load = self.returnbadfunc
            populate_entry_points([mock_entry_badfunc])
        except AstropyUserWarning as w:
            if (u'Class' in w.args[0]):
                pass
            else:
                raise w
        else:
            raise self.exception_not_thrown
