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

Side by Side Diff: Lib/test/test_imp.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 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_import.py ('k') | Lib/test/test_ioctl.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 import imp 1 import imp
2 import os 2 import os
3 import os.path 3 import os.path
4 import shutil 4 import shutil
5 import sys 5 import sys
6 import unittest 6 import unittest
7 from test import support 7 from test import support
8 import importlib 8 import importlib
9 9
10 class LockTests(unittest.TestCase): 10 class LockTests(unittest.TestCase):
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 def test_package___file__(self): 317 def test_package___file__(self):
318 # Test that a package's __file__ points to the right source directory. 318 # Test that a package's __file__ points to the right source directory.
319 os.mkdir('pep3147') 319 os.mkdir('pep3147')
320 sys.path.insert(0, os.curdir) 320 sys.path.insert(0, os.curdir)
321 def cleanup(): 321 def cleanup():
322 if sys.path[0] == os.curdir: 322 if sys.path[0] == os.curdir:
323 del sys.path[0] 323 del sys.path[0]
324 shutil.rmtree('pep3147') 324 shutil.rmtree('pep3147')
325 self.addCleanup(cleanup) 325 self.addCleanup(cleanup)
326 # Touch the __init__.py file. 326 # Touch the __init__.py file.
327 support.create_empty_file('pep3147/__init__.py') 327 with open('pep3147/__init__.py', 'w'):
328 pass
328 m = __import__('pep3147') 329 m = __import__('pep3147')
329 # Ensure we load the pyc file. 330 # Ensure we load the pyc file.
330 support.forget('pep3147') 331 support.forget('pep3147')
331 m = __import__('pep3147') 332 m = __import__('pep3147')
332 self.assertEqual(m.__file__, 333 self.assertEqual(m.__file__,
333 os.sep.join(('.', 'pep3147', '__init__.py'))) 334 os.sep.join(('.', 'pep3147', '__init__.py')))
334 335
335 336
336 class NullImporterTests(unittest.TestCase): 337 class NullImporterTests(unittest.TestCase):
337 @unittest.skipIf(support.TESTFN_UNENCODABLE is None, 338 @unittest.skipIf(support.TESTFN_UNENCODABLE is None,
(...skipping 17 matching lines...) Expand all
355 try: 356 try:
356 import _thread 357 import _thread
357 except ImportError: 358 except ImportError:
358 pass 359 pass
359 else: 360 else:
360 tests.append(LockTests) 361 tests.append(LockTests)
361 support.run_unittest(*tests) 362 support.run_unittest(*tests)
362 363
363 if __name__ == "__main__": 364 if __name__ == "__main__":
364 test_main() 365 test_main()
OLDNEW
« no previous file with comments | « Lib/test/test_import.py ('k') | Lib/test/test_ioctl.py » ('j') | no next file with comments »

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