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

Unified Diff: Lib/test/test_runpy.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_robotparser.py ('k') | Lib/test/test_shutil.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_runpy.py Tue Jul 26 09:37:46 2011 +0300
+++ b/Lib/test/test_runpy.py Mon Jul 25 09:47:18 2011 -0400
@@ -7,8 +7,7 @@
import tempfile
import py_compile
from test.support import (
- forget, make_legacy_pyc, run_unittest, unload, verbose, no_tracing,
- create_empty_file)
+ forget, make_legacy_pyc, run_unittest, unload, verbose, no_tracing)
from test.script_helper import (
make_pkg, make_script, make_zip_pkg, make_zip_script, temp_dir)
@@ -114,7 +113,8 @@
def _add_pkg_dir(self, pkg_dir):
os.mkdir(pkg_dir)
pkg_fname = os.path.join(pkg_dir, "__init__.py")
- create_empty_file(pkg_fname)
+ pkg_file = open(pkg_fname, "w")
+ pkg_file.close()
return pkg_fname
def _make_pkg(self, source, depth, mod_base="runpy_test"):
@@ -219,7 +219,8 @@
module_dir = os.path.join(module_dir, pkg_name)
# Add sibling module
sibling_fname = os.path.join(module_dir, "sibling.py")
- create_empty_file(sibling_fname)
+ sibling_file = open(sibling_fname, "w")
+ sibling_file.close()
if verbose: print(" Added sibling module:", sibling_fname)
# Add nephew module
uncle_dir = os.path.join(parent_dir, "uncle")
@@ -229,7 +230,8 @@
self._add_pkg_dir(cousin_dir)
if verbose: print(" Added cousin package:", cousin_dir)
nephew_fname = os.path.join(cousin_dir, "nephew.py")
- create_empty_file(nephew_fname)
+ nephew_file = open(nephew_fname, "w")
+ nephew_file.close()
if verbose: print(" Added nephew module:", nephew_fname)
def _check_relative_imports(self, depth, run_name=None):
@@ -405,16 +407,6 @@
msg = "recursion depth exceeded"
self.assertRaisesRegex(RuntimeError, msg, run_path, zip_name)
- def test_encoding(self):
- with temp_dir() as script_dir:
- filename = os.path.join(script_dir, 'script.py')
- with open(filename, 'w', encoding='latin1') as f:
- f.write("""
-#coding:latin1
-"non-ASCII: h\xe9"
-""")
- result = run_path(filename)
- self.assertEqual(result['__doc__'], "non-ASCII: h\xe9")
def test_main():
« no previous file with comments | « Lib/test/test_robotparser.py ('k') | Lib/test/test_shutil.py » ('j') | no next file with comments »

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