def METHOD_NAME(self):
    m = ModuleType('foo')
    del m.__name__
    # Yes, a class not an instance.
    m.__loader__ = BareLoader
    loader_repr = repr(BareLoader)
    self.assertEqual(
        repr(m), "<module '?' ({})>".format(loader_repr))