mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Merged revisions 76362 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76362 | nick.coghlan | 2009-11-18 21:27:53 +1000 (Wed, 18 Nov 2009) | 1 line Correctly escape arbitrary error message text in the runpy unit tests ........
This commit is contained in:
parent
11c9d251ef
commit
16eb0fbbd0
1 changed files with 2 additions and 2 deletions
|
@ -3,6 +3,7 @@ import unittest
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
|
import re
|
||||||
import tempfile
|
import tempfile
|
||||||
from test.support import verbose, run_unittest, forget
|
from test.support import verbose, run_unittest, forget
|
||||||
from test.script_helper import (temp_dir, make_script, compile_script,
|
from test.script_helper import (temp_dir, make_script, compile_script,
|
||||||
|
@ -290,8 +291,7 @@ argv0 = sys.argv[0]
|
||||||
self.assertEqual(result["__package__"], expected_package)
|
self.assertEqual(result["__package__"], expected_package)
|
||||||
|
|
||||||
def _check_import_error(self, script_name, msg):
|
def _check_import_error(self, script_name, msg):
|
||||||
# Double backslashes to handle path separators on Windows
|
msg = re.escape(msg)
|
||||||
msg = msg.replace("\\", "\\\\")
|
|
||||||
self.assertRaisesRegexp(ImportError, msg, run_path, script_name)
|
self.assertRaisesRegexp(ImportError, msg, run_path, script_name)
|
||||||
|
|
||||||
def test_basic_script(self):
|
def test_basic_script(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue