Issue #9517: Move script_helper to the support package.

Patch by Christie Wilson.
This commit is contained in:
Berker Peksag 2015-05-06 06:33:17 +03:00
parent 025e9ebd0a
commit ce643913a9
45 changed files with 115 additions and 102 deletions

View file

@ -14,8 +14,8 @@ import inspect
import linecache
import pdb
import unittest
from test.script_helper import (spawn_python, kill_python, assert_python_ok,
temp_dir, make_script, make_zip_script)
from test.support.script_helper import (spawn_python, kill_python, assert_python_ok,
make_script, make_zip_script)
verbose = test.support.verbose
@ -78,7 +78,7 @@ class ZipSupportTests(unittest.TestCase):
def test_inspect_getsource_issue4223(self):
test_src = "def foo(): pass\n"
with temp_dir() as d:
with test.support.temp_dir() as d:
init_name = make_script(d, '__init__', test_src)
name_in_zip = os.path.join('zip_pkg',
os.path.basename(init_name))
@ -118,7 +118,7 @@ class ZipSupportTests(unittest.TestCase):
mod_name = mod_name.replace("sample_", "sample_zipped_")
sample_sources[mod_name] = src
with temp_dir() as d:
with test.support.temp_dir() as d:
script_name = make_script(d, 'test_zipped_doctest',
test_src)
zip_name, run_name = make_zip_script(d, 'test_zip',
@ -195,7 +195,7 @@ class ZipSupportTests(unittest.TestCase):
doctest.testmod()
""")
pattern = 'File "%s", line 2, in %s'
with temp_dir() as d:
with test.support.temp_dir() as d:
script_name = make_script(d, 'script', test_src)
rc, out, err = assert_python_ok(script_name)
expected = pattern % (script_name, "__main__.Test")
@ -222,7 +222,7 @@ class ZipSupportTests(unittest.TestCase):
import pdb
pdb.Pdb(nosigint=True).runcall(f)
""")
with temp_dir() as d:
with test.support.temp_dir() as d:
script_name = make_script(d, 'script', test_src)
p = spawn_python(script_name)
p.stdin.write(b'l\n')