summaryrefslogtreecommitdiffstats
path: root/test/errors.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/errors.py')
-rw-r--r--test/errors.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/test/errors.py b/test/errors.py
index 120ea3a..6e0a05f 100644
--- a/test/errors.py
+++ b/test/errors.py
@@ -29,7 +29,7 @@ import TestSCons
import string
import sys
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons(match = TestCmd.match_re_dotall)
@@ -85,7 +85,7 @@ a.append(2)
test.run(status = 2, stderr = """\
AttributeError: 'int' object has no attribute 'append':
- File "SConstruct", line 2:
+ File ".+SConstruct", line 2:
a.append\(2\)
""")
@@ -98,7 +98,7 @@ a == 1
test.run(status = 2, stderr = """\
NameError: [^\n]*
- File "SConstruct", line 1:
+ File ".+SConstruct", line 1:
a == 1
""")
@@ -110,7 +110,7 @@ a ! x
""")
test.run(stdout = "scons: Reading SConscript files ...\n",
- stderr = """ File "SConstruct", line 2
+ stderr = """ File ".+SConstruct", line 2
a ! x
@@ -130,7 +130,7 @@ a[2] = 3
test.run(status = 2, stderr = """\
TypeError: object does not support item assignment:
- File "SConstruct", line 2:
+ File ".+SConstruct", line 2:
a\[2\] = 3
""")
@@ -146,7 +146,7 @@ raise SCons.Errors.UserError, 'Depends() require both sources and targets.'
test.run(stdout = "scons: Reading SConscript files ...\n",
stderr = """
scons: \*\*\* Depends\(\) require both sources and targets.
-File "SConstruct", line 4, in \?
+File ".+SConstruct", line 4, in \?
""", status=2)
@@ -163,7 +163,7 @@ test.run(stdout = "scons: Reading SConscript files ...\ninternal error\n",
File ".+", line \d+, in .+
File ".+", line \d+, in .+
File ".+", line \d+, in .+
- File "SConstruct", line \d+, in \?
+ File ".+SConstruct", line \d+, in \?
raise InternalError, 'error inside'
InternalError: error inside
""", status=2)
@@ -178,8 +178,10 @@ sys.exit(2)
# Test ...
test.write('SConstruct', """
env=Environment()
-Default(env.Command(['one.out', 'two.out'], ['foo.in'], action=r'%s build.py'))
-"""%python)
+Default(env.Command(['one.out', 'two.out'],
+ ['foo.in'],
+ action=r'%(_python_)s build.py'))
+""" % locals())
test.run(status=2, stderr="scons: \\*\\*\\* \\[one.out\\] Error 2\n")