mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
merge with 3.3
This commit is contained in:
commit
f41fa4f3a0
1 changed files with 10 additions and 7 deletions
|
|
@ -4,6 +4,7 @@
|
|||
from importlib import machinery
|
||||
import sys
|
||||
from test import support
|
||||
import types
|
||||
import unittest
|
||||
|
||||
|
||||
|
|
@ -175,13 +176,15 @@ def test_no_frozen_importlib(self):
|
|||
machinery.FrozenImporter))
|
||||
|
||||
|
||||
def test_main():
|
||||
from test.support import run_unittest
|
||||
run_unittest(ImportModuleTests,
|
||||
FindLoaderTests,
|
||||
InvalidateCacheTests,
|
||||
FrozenImportlibTests)
|
||||
class StartupTests(unittest.TestCase):
|
||||
|
||||
def test_everyone_has___loader__(self):
|
||||
# Issue #17098: all modules should have __loader__ defined.
|
||||
for name, module in sys.modules.items():
|
||||
if isinstance(module, types.ModuleType):
|
||||
self.assertTrue(hasattr(module, '__loader__'),
|
||||
'{!r} lacks a __loader__ attribute'.format(name))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_main()
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue