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

Side by Side Diff: Lib/distutils/tests/test_install_lib.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 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/distutils/tests/test_cygwinccompiler.py ('k') | Lib/distutils/tests/test_install.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 """Tests for distutils.command.install_data.""" 1 """Tests for distutils.command.install_data."""
2 import sys 2 import sys
3 import os 3 import os
4 import importlib.util 4 import importlib.util
5 import unittest 5 import unittest
6 6
7 from distutils.command.install_lib import install_lib 7 from distutils.command.install_lib import install_lib
8 from distutils.extension import Extension 8 from distutils.extension import Extension
9 from distutils.tests import support 9 from distutils.tests import support
10 from distutils.errors import DistutilsOptionError 10 from distutils.errors import DistutilsOptionError
(...skipping 17 matching lines...) Expand all
28 cmd.optimize = 'foo' 28 cmd.optimize = 'foo'
29 self.assertRaises(DistutilsOptionError, cmd.finalize_options) 29 self.assertRaises(DistutilsOptionError, cmd.finalize_options)
30 cmd.optimize = '4' 30 cmd.optimize = '4'
31 self.assertRaises(DistutilsOptionError, cmd.finalize_options) 31 self.assertRaises(DistutilsOptionError, cmd.finalize_options)
32 32
33 cmd.optimize = '2' 33 cmd.optimize = '2'
34 cmd.finalize_options() 34 cmd.finalize_options()
35 self.assertEqual(cmd.optimize, 2) 35 self.assertEqual(cmd.optimize, 2)
36 36
37 @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled') 37 @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled')
38 @unittest.skipUnless(os.name == 'nt' or (os.name == 'posix' and hasattr(os, 'fork')), "distutils cannot spawn child processes")
38 def test_byte_compile(self): 39 def test_byte_compile(self):
39 project_dir, dist = self.create_dist() 40 project_dir, dist = self.create_dist()
40 os.chdir(project_dir) 41 os.chdir(project_dir)
41 cmd = install_lib(dist) 42 cmd = install_lib(dist)
42 cmd.compile = cmd.optimize = 1 43 cmd.compile = cmd.optimize = 1
43 44
44 f = os.path.join(project_dir, 'foo.py') 45 f = os.path.join(project_dir, 'foo.py')
45 self.write_file(f, '# python file') 46 self.write_file(f, '# python file')
46 cmd.byte_compile([f]) 47 cmd.byte_compile([f])
47 pyc_file = importlib.util.cache_from_source('foo.py', optimization='') 48 pyc_file = importlib.util.cache_from_source('foo.py', optimization='')
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 sys.dont_write_bytecode = old_dont_write_bytecode 106 sys.dont_write_bytecode = old_dont_write_bytecode
106 107
107 self.assertIn('byte-compiling is disabled', self.logs[0][1]) 108 self.assertIn('byte-compiling is disabled', self.logs[0][1])
108 109
109 110
110 def test_suite(): 111 def test_suite():
111 return unittest.makeSuite(InstallLibTestCase) 112 return unittest.makeSuite(InstallLibTestCase)
112 113
113 if __name__ == "__main__": 114 if __name__ == "__main__":
114 run_unittest(test_suite()) 115 run_unittest(test_suite())
OLDNEW
« no previous file with comments | « Lib/distutils/tests/test_cygwinccompiler.py ('k') | Lib/distutils/tests/test_install.py » ('j') | no next file with comments »

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