mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #9517: Move script_helper to the support package.
Patch by Christie Wilson.
This commit is contained in:
parent
025e9ebd0a
commit
ce643913a9
45 changed files with 115 additions and 102 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue