diff options
author | Joachim Kuebart <joachim.kuebart@gmail.com> | 2020-08-11 18:50:31 (GMT) |
---|---|---|
committer | Joachim Kuebart <joachim.kuebart@gmail.com> | 2020-08-11 18:50:34 (GMT) |
commit | 5fa8009133ed8bd61828fafae4f0a14869fc8c23 (patch) | |
tree | d162eb25d93cb41f557da31b4041a91ec2f8b247 /test | |
parent | 0949d5bbe3056e51e45b3975c0c3a1fb36be1c14 (diff) | |
download | SCons-5fa8009133ed8bd61828fafae4f0a14869fc8c23.zip SCons-5fa8009133ed8bd61828fafae4f0a14869fc8c23.tar.gz SCons-5fa8009133ed8bd61828fafae4f0a14869fc8c23.tar.bz2 |
Convert new e2e test to file fixture.
Diffstat (limited to 'test')
-rw-r--r-- | test/SConscript/fixture/SConstruct | 17 | ||||
-rw-r--r-- | test/SConscript/must_exist_deprecation.py | 20 |
2 files changed, 18 insertions, 19 deletions
diff --git a/test/SConscript/fixture/SConstruct b/test/SConscript/fixture/SConstruct new file mode 100644 index 0000000..a955efc --- /dev/null +++ b/test/SConscript/fixture/SConstruct @@ -0,0 +1,17 @@ +import SCons +from SCons.Warnings import _warningOut +import sys + +DefaultEnvironment(tools=[]) +# 1. call should succeed without deprecation warning +try: + SConscript('missing/SConscript', must_exist=False) +except SCons.Errors.UserError as e: + if _warningOut: + _warningOut(e) +# 2. call should succeed with deprecation warning +try: + SConscript('missing/SConscript') +except SCons.Errors.UserError as e: + if _warningOut: + _warningOut(e) diff --git a/test/SConscript/must_exist_deprecation.py b/test/SConscript/must_exist_deprecation.py index 86f753b..8b267ce 100644 --- a/test/SConscript/must_exist_deprecation.py +++ b/test/SConscript/must_exist_deprecation.py @@ -36,25 +36,7 @@ test = TestSCons.TestSCons() # catch the exception if is raised, send it on as a warning # this gives us traceability of the line responsible SConstruct_path = test.workpath('SConstruct') -test.write(SConstruct_path, """\ -import SCons -from SCons.Warnings import _warningOut -import sys - -DefaultEnvironment(tools=[]) -# 1. call should succeed without deprecation warning -try: - SConscript('missing/SConscript', must_exist=False) -except SCons.Errors.UserError as e: - if _warningOut: - _warningOut(e) -# 2. call should succeed with deprecation warning -try: - SConscript('missing/SConscript') -except SCons.Errors.UserError as e: - if _warningOut: - _warningOut(e) -""") +test.file_fixture("fixture/SConstruct") # we should see two warnings, the second being the deprecation message. # need to build the path in the expected msg in an OS-agnostic way |