Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(169616)

Side by Side Diff: Lib/test/test_import/__init__.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_httpservers.py ('k') | Lib/test/test_importlib/extension/test_finder.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # We import importlib *ASAP* in order to test #15386 1 # We import importlib *ASAP* in order to test #15386
2 import importlib 2 import importlib
3 import importlib.util 3 import importlib.util
4 from importlib._bootstrap_external import _get_sourcefile 4 from importlib._bootstrap_external import _get_sourcefile
5 import builtins 5 import builtins
6 import marshal 6 import marshal
7 import os 7 import os
8 import platform 8 import platform
9 import py_compile 9 import py_compile
10 import random 10 import random
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 # Issue 4236 271 # Issue 4236
272 testfn = script_helper.make_script('', TESTFN, textwrap.dedent("""\ 272 testfn = script_helper.make_script('', TESTFN, textwrap.dedent("""\
273 import sys 273 import sys
274 class C: 274 class C:
275 def __del__(self): 275 def __del__(self):
276 import importlib 276 import importlib
277 sys.argv.insert(0, C()) 277 sys.argv.insert(0, C())
278 """)) 278 """))
279 script_helper.assert_python_ok(testfn) 279 script_helper.assert_python_ok(testfn)
280 280
281 @skip_if_dont_write_bytecode
281 def test_timestamp_overflow(self): 282 def test_timestamp_overflow(self):
282 # A modification timestamp larger than 2**32 should not be a problem 283 # A modification timestamp larger than 2**32 should not be a problem
283 # when importing a module (issue #11235). 284 # when importing a module (issue #11235).
284 sys.path.insert(0, os.curdir) 285 sys.path.insert(0, os.curdir)
285 try: 286 try:
286 source = TESTFN + ".py" 287 source = TESTFN + ".py"
287 compiled = importlib.util.cache_from_source(source) 288 compiled = importlib.util.cache_from_source(source)
288 with open(source, 'w') as f: 289 with open(source, 'w') as f:
289 pass 290 pass
290 try: 291 try:
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 import test.test_import.data.circular_imports.rebinding as rebinding 1123 import test.test_import.data.circular_imports.rebinding as rebinding
1123 except ImportError: 1124 except ImportError:
1124 self.fail('circular import with rebinding of module attribute failed ') 1125 self.fail('circular import with rebinding of module attribute failed ')
1125 from test.test_import.data.circular_imports.subpkg import util 1126 from test.test_import.data.circular_imports.subpkg import util
1126 self.assertIs(util.util, rebinding.util) 1127 self.assertIs(util.util, rebinding.util)
1127 1128
1128 1129
1129 if __name__ == '__main__': 1130 if __name__ == '__main__':
1130 # Test needs to be a package, so we can do relative imports. 1131 # Test needs to be a package, so we can do relative imports.
1131 unittest.main() 1132 unittest.main()
OLDNEW
« no previous file with comments | « Lib/test/test_httpservers.py ('k') | Lib/test/test_importlib/extension/test_finder.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+