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

Side by Side Diff: Lib/distutils/tests/test_build_py.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_build_ext.py ('k') | Lib/distutils/tests/test_config_cmd.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.build_py.""" 1 """Tests for distutils.command.build_py."""
2 2
3 import os 3 import os
4 import sys 4 import sys
5 import unittest 5 import unittest
6 6
7 from distutils.command.build_py import build_py 7 from distutils.command.build_py import build_py
8 from distutils.core import Distribution 8 from distutils.core import Distribution
9 from distutils.errors import DistutilsFileError 9 from distutils.errors import DistutilsFileError
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 cmd.finalize_options() 99 cmd.finalize_options()
100 cmd.run() 100 cmd.run()
101 101
102 found = os.listdir(cmd.build_lib) 102 found = os.listdir(cmd.build_lib)
103 self.assertEqual(sorted(found), ['__pycache__', 'boiledeggs.py']) 103 self.assertEqual(sorted(found), ['__pycache__', 'boiledeggs.py'])
104 found = os.listdir(os.path.join(cmd.build_lib, '__pycache__')) 104 found = os.listdir(os.path.join(cmd.build_lib, '__pycache__'))
105 self.assertEqual(found, 105 self.assertEqual(found,
106 ['boiledeggs.%s.pyc' % sys.implementation.cache_tag]) 106 ['boiledeggs.%s.pyc' % sys.implementation.cache_tag])
107 107
108 @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled') 108 @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled')
109 @unittest.skipUnless(os.name == 'nt' or (os.name == 'posix' and hasattr(os, 'fork')), "distutils cannot spawn child processes")
109 def test_byte_compile_optimized(self): 110 def test_byte_compile_optimized(self):
110 project_dir, dist = self.create_dist(py_modules=['boiledeggs']) 111 project_dir, dist = self.create_dist(py_modules=['boiledeggs'])
111 os.chdir(project_dir) 112 os.chdir(project_dir)
112 self.write_file('boiledeggs.py', 'import antigravity') 113 self.write_file('boiledeggs.py', 'import antigravity')
113 cmd = build_py(dist) 114 cmd = build_py(dist)
114 cmd.compile = 0 115 cmd.compile = 0
115 cmd.optimize = 1 116 cmd.optimize = 1
116 cmd.build_lib = 'here' 117 cmd.build_lib = 'here'
117 cmd.finalize_options() 118 cmd.finalize_options()
118 cmd.run() 119 cmd.run()
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 sys.dont_write_bytecode = old_dont_write_bytecode 170 sys.dont_write_bytecode = old_dont_write_bytecode
170 171
171 self.assertIn('byte-compiling is disabled', self.logs[0][1]) 172 self.assertIn('byte-compiling is disabled', self.logs[0][1])
172 173
173 174
174 def test_suite(): 175 def test_suite():
175 return unittest.makeSuite(BuildPyTestCase) 176 return unittest.makeSuite(BuildPyTestCase)
176 177
177 if __name__ == "__main__": 178 if __name__ == "__main__":
178 run_unittest(test_suite()) 179 run_unittest(test_suite())
OLDNEW
« no previous file with comments | « Lib/distutils/tests/test_build_ext.py ('k') | Lib/distutils/tests/test_config_cmd.py » ('j') | no next file with comments »

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