def test_lacking_parent(self):
    with util.create_modules('_pkg.__init__', '_pkg.mod') as mapping:
        loader = self.machinery.SourceFileLoader('_pkg.mod', mapping['_pkg.mod'])
        with warnings.catch_warnings():
            warnings.simplefilter('ignore', DeprecationWarning)
            module = loader.load_module('_pkg.mod')
        self.assertIn('_pkg.mod', sys.modules)
        check = {'__name__': '_pkg.mod', '__file__': mapping['_pkg.mod'], '__package__': '_pkg'}
        for (attr, value) in check.items():
            self.assertEqual(getattr(module, attr), value)
def test_lacking_parent(self):
    with util.create_modules('_pkg.__init__', '_pkg.mod') as mapping:
        loader = self.machinery.SourceFileLoader('_pkg.mod', mapping['_pkg.mod'])
        with warnings.catch_warnings():
            warnings.simplefilter('ignore', DeprecationWarning)
            module = loader.load_module('_pkg.mod')
        self.assertIn('_pkg.mod', sys.modules)
        check = {'__name__': '_pkg.mod', '__file__': mapping['_pkg.mod'], '__package__': '_pkg'}
        for (attr, value) in check.items():
            self.assertEqual(getattr(module, attr), value)