def METHOD_NAME(self):
    # Because the loader has no module_repr(), use the file name.
    m = ModuleType('foo')
    # Yes, a class not an instance.
    m.__loader__ = BareLoader
    m.__file__ = '/tmp/foo.py'
    self.assertEqual(repr(m), "<module 'foo' from '/tmp/foo.py'>")