def METHOD_NAME(self):
    patcher = patch('%s.X' % __name__, spec_set=X())
    mock = patcher.start()
    self.addCleanup(patcher.stop)
    self.assertNotCallable(mock)
    self.assertRaises(TypeError, mock)