diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-10-08 18:05:42 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-10-08 18:05:42 (GMT) |
commit | f51d8d3a2ede7ff3330e2a868feb4ecdda0b92c0 (patch) | |
tree | 8a5a261dc53a7b2a20c5bc12c48c25f77122eea9 /Lib/test/test_zipimport_support.py | |
parent | 0ee4c9f274960bb717492b0827f6d22af0b1e60b (diff) | |
download | cpython-f51d8d3a2ede7ff3330e2a868feb4ecdda0b92c0.zip cpython-f51d8d3a2ede7ff3330e2a868feb4ecdda0b92c0.tar.gz cpython-f51d8d3a2ede7ff3330e2a868feb4ecdda0b92c0.tar.bz2 |
Better Python spawning primitives in test.script_helper, for
easier writing of unit tests and better error reporting.
Diffstat (limited to 'Lib/test/test_zipimport_support.py')
-rw-r--r-- | Lib/test/test_zipimport_support.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_zipimport_support.py b/Lib/test/test_zipimport_support.py index 27e0bf8..aed7f19 100644 --- a/Lib/test/test_zipimport_support.py +++ b/Lib/test/test_zipimport_support.py @@ -13,7 +13,7 @@ import doctest import inspect import linecache import pdb -from test.script_helper import (spawn_python, kill_python, run_python, +from test.script_helper import (spawn_python, kill_python, assert_python_ok, temp_dir, make_script, make_zip_script) verbose = test.support.verbose @@ -177,22 +177,22 @@ class ZipSupportTests(ImportHooksBaseTestCase): pattern = 'File "%s", line 2, in %s' with temp_dir() as d: script_name = make_script(d, 'script', test_src) - exit_code, data = run_python(script_name) + rc, out, err = assert_python_ok(script_name) expected = pattern % (script_name, "__main__.Test") if verbose: print ("Expected line", expected) print ("Got stdout:") - print (data) - self.assertIn(expected.encode('utf-8'), data) + print (out) + self.assertIn(expected.encode('utf-8'), out) zip_name, run_name = make_zip_script(d, "test_zip", script_name, '__main__.py') - exit_code, data = run_python(zip_name) + rc, out, err = assert_python_ok(zip_name) expected = pattern % (run_name, "__main__.Test") if verbose: print ("Expected line", expected) print ("Got stdout:") - print (data) - self.assertIn(expected.encode('utf-8'), data) + print (out) + self.assertIn(expected.encode('utf-8'), out) def test_pdb_issue4201(self): test_src = textwrap.dedent("""\ |