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

Side by Side Diff: Lib/distutils/tests/test_build_py.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/distutils/tests/test_build_ext.py ('k') | Lib/doctest.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 io 5 import io
6 import unittest 6 import unittest
7 7
8 from distutils.command.build_py import build_py 8 from distutils.command.build_py import build_py
9 from distutils.core import Distribution 9 from distutils.core import Distribution
10 from distutils.errors import DistutilsFileError 10 from distutils.errors import DistutilsFileError
11 11
12 from distutils.tests import support 12 from distutils.tests import support
13 from test.support import run_unittest, create_empty_file 13 from test.support import run_unittest
14 14
15 15
16 class BuildPyTestCase(support.TempdirManager, 16 class BuildPyTestCase(support.TempdirManager,
17 support.LoggingSilencer, 17 support.LoggingSilencer,
18 unittest.TestCase): 18 unittest.TestCase):
19 19
20 def test_package_data(self): 20 def test_package_data(self):
21 sources = self.mkdtemp() 21 sources = self.mkdtemp()
22 f = open(os.path.join(sources, "__init__.py"), "w") 22 f = open(os.path.join(sources, "__init__.py"), "w")
23 try: 23 try:
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 self.assertNotIn("__init__.pyc", files) 64 self.assertNotIn("__init__.pyc", files)
65 else: 65 else:
66 self.assertIn("__init__.pyc", files) 66 self.assertIn("__init__.pyc", files)
67 67
68 def test_empty_package_dir(self): 68 def test_empty_package_dir(self):
69 # See SF 1668596/1720897. 69 # See SF 1668596/1720897.
70 cwd = os.getcwd() 70 cwd = os.getcwd()
71 71
72 # create the distribution files. 72 # create the distribution files.
73 sources = self.mkdtemp() 73 sources = self.mkdtemp()
74 create_empty_file(os.path.join(sources, "__init__.py")) 74 open(os.path.join(sources, "__init__.py"), "w").close()
75 75
76 testdir = os.path.join(sources, "doc") 76 testdir = os.path.join(sources, "doc")
77 os.mkdir(testdir) 77 os.mkdir(testdir)
78 create_empty_file(os.path.join(testdir, "testfile")) 78 open(os.path.join(testdir, "testfile"), "w").close()
79 79
80 os.chdir(sources) 80 os.chdir(sources)
81 old_stdout = sys.stdout 81 old_stdout = sys.stdout
82 sys.stdout = io.StringIO() 82 sys.stdout = io.StringIO()
83 83
84 try: 84 try:
85 dist = Distribution({"packages": ["pkg"], 85 dist = Distribution({"packages": ["pkg"],
86 "package_dir": {"pkg": ""}, 86 "package_dir": {"pkg": ""},
87 "package_data": {"pkg": ["doc/*"]}}) 87 "package_data": {"pkg": ["doc/*"]}})
88 # script_name need not exist, it just need to be initialized 88 # script_name need not exist, it just need to be initialized
(...skipping 24 matching lines...) Expand all
113 finally: 113 finally:
114 sys.dont_write_bytecode = old_dont_write_bytecode 114 sys.dont_write_bytecode = old_dont_write_bytecode
115 115
116 self.assertIn('byte-compiling is disabled', self.logs[0][1]) 116 self.assertIn('byte-compiling is disabled', self.logs[0][1])
117 117
118 def test_suite(): 118 def test_suite():
119 return unittest.makeSuite(BuildPyTestCase) 119 return unittest.makeSuite(BuildPyTestCase)
120 120
121 if __name__ == "__main__": 121 if __name__ == "__main__":
122 run_unittest(test_suite()) 122 run_unittest(test_suite())
OLDNEW
« no previous file with comments | « Lib/distutils/tests/test_build_ext.py ('k') | Lib/doctest.py » ('j') | no next file with comments »

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