PyDocs

Development Tools

test.support.script_helper

The test.support.script_helper module provides support for Python’s script execution tests.
Symbols in test.support.script_helper

a

assert_python_failure
Assert that running the interpreter with args and optional environment variables env_vars fails (rc != 0) and return a (return code, stdout, stderr) tuple.
assert_python_ok
Assert that running the interpreter with args and optional environment variables env_vars succeeds (rc == 0) and return a (return code, stdout, stderr) tuple.

i

interpreter_requires_environment
Return True if sys.executable interpreter requires environment variables in order to be able to run at all.

k

kill_python
Run the given subprocess.Popen process until completion and return stdout.

m

make_pkg
Create a directory named pkg_dir containing an __init__ file with init_source as its contents.
make_script
Create script containing source in path script_dir and script_basename.
make_zip_pkg
Create a zip package directory with a path of zip_dir and zip_basename containing an empty __init__ file and a file script_basename containing the source.
make_zip_script
Create zip file at zip_dir and zip_basename with extension zip which contains the files in script_name.

r

run_python_until_end
Set up the environment based on env_vars for running the interpreter in a subprocess.

s

spawn_python
Run a Python subprocess with the given arguments.