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