diff options
author | William Deegan <bill@baddogconsulting.com> | 2023-05-09 12:48:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-09 12:48:42 -0700 |
commit | 39285a666b3a2ca2c84c57a670a4a00833a2d814 (patch) | |
tree | 08379e7d0496dafab1aed2e5f7974044947da316 /test/runtest/simple/fail.py | |
parent | fcb92c4ff1503ac0cf920d26f771b8f47386f4dc (diff) | |
parent | faa271d1dd379d5fe46ca2742f5a83e54ea4f36c (diff) | |
download | scons-git-39285a666b3a2ca2c84c57a670a4a00833a2d814.tar.gz |
Merge pull request #4340 from mwichmann/test/runtest-pathlib
Use pathlib in runtest
Diffstat (limited to 'test/runtest/simple/fail.py')
-rw-r--r-- | test/runtest/simple/fail.py | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/test/runtest/simple/fail.py b/test/runtest/simple/fail.py index f26f00e9a..5e1979a1b 100644 --- a/test/runtest/simple/fail.py +++ b/test/runtest/simple/fail.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,38 +22,35 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test how we handle a failing test specified on the command line. """ +import os + import TestRuntest pythonstring = TestRuntest.pythonstring pythonflags = TestRuntest.pythonflags +test_fail_py = os.path.join('test', 'fail.py') test = TestRuntest.TestRuntest() - test.subdir('test') - test.write_failing_test(['test', 'fail.py']) -expect_stdout = """\ -%(pythonstring)s%(pythonflags)s test/fail.py +expect_stdout = f"""\ +{pythonstring}{pythonflags} {test_fail_py} FAILING TEST STDOUT -""" % locals() +""" expect_stderr = """\ FAILING TEST STDERR """ -test.run(arguments='-k test/fail.py', - status=1, - stdout=expect_stdout, - stderr=expect_stderr) +test.run( + arguments='-k test/fail.py', status=1, stdout=expect_stdout, stderr=expect_stderr +) test.pass_test() |