diff options
Diffstat (limited to 'test/errors.py')
-rw-r--r-- | test/errors.py | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/test/errors.py b/test/errors.py index 09a741b..cff8087 100644 --- a/test/errors.py +++ b/test/errors.py @@ -7,14 +7,14 @@ import TestSCons test = TestSCons.TestSCons() test.write('SConstruct1', """ -a ! int(2.0) +a ! x """) -test.run(arguments='-f SConstruct1') -test.fail_test(test.stderr() != """ File "SConstruct1", line 2 - a ! int(2.0) +test.run(arguments='-f SConstruct1', stderr = """ File "SConstruct1", line 2 - ^ + a ! x + + \^ SyntaxError: invalid syntax @@ -24,18 +24,15 @@ SyntaxError: invalid syntax test.write('SConstruct2', """ raise UserError, 'Depends() require both sources and targets.' """) -test.run(arguments='-f SConstruct2') -test.fail_test(test.stderr() != """ -SCons error: Depends() require both sources and targets. -File "SConstruct2", line 2, in ? +test.run(arguments='-f SConstruct2', stderr = """ +SCons error: Depends\(\) require both sources and targets. +File "SConstruct2", line 2, in \? """) - test.write('SConstruct3', """ raise InternalError, 'error inside' """) -test.run(arguments='-f SConstruct3') -expect = r"""Traceback \((most recent call|innermost) last\): +test.run(arguments='-f SConstruct3', stderr = r"""Traceback \((most recent call|innermost) last\): File ".*scons\.py", line \d+, in \? main\(\) File ".*scons\.py", line \d+, in main @@ -43,7 +40,6 @@ expect = r"""Traceback \((most recent call|innermost) last\): File "SConstruct3", line \d+, in \? raise InternalError, 'error inside' InternalError: error inside -""" -test.fail_test(not test.match_re(test.stderr(), expect)) +""") test.pass_test() |