summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/ActionTests.py
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-05-28 23:16:31 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-05-28 23:16:31 (GMT)
commit4599444f86e113d52c6ccad970d78d7821021e46 (patch)
tree217726972bfa0737453c61e4147215f1d4e4d723 /src/engine/SCons/ActionTests.py
parent351f3e1e53a9a66e59bae23f560a7a6ab49845cd (diff)
downloadSCons-4599444f86e113d52c6ccad970d78d7821021e46.zip
SCons-4599444f86e113d52c6ccad970d78d7821021e46.tar.gz
SCons-4599444f86e113d52c6ccad970d78d7821021e46.tar.bz2
py2/3 better messaging for actiontest failures
Diffstat (limited to 'src/engine/SCons/ActionTests.py')
-rw-r--r--src/engine/SCons/ActionTests.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/engine/SCons/ActionTests.py b/src/engine/SCons/ActionTests.py
index bf459ec..7f7fe05 100644
--- a/src/engine/SCons/ActionTests.py
+++ b/src/engine/SCons/ActionTests.py
@@ -1826,7 +1826,7 @@ class LazyActionTestCase(unittest.TestCase):
env = Environment(FOO = factory(GlobalFunc))
c = a.get_contents(target=[], source=[], env=env)
- assert c in func_matches, repr(c)
+ assert c in func_matches, "Got\n"+repr(c)+"\nExpected one of \n"+"\n".join([repr(f) for f in func_matches])
env = Environment(FOO = factory(LocalFunc))
c = a.get_contents(target=[], source=[], env=env)
@@ -1867,12 +1867,12 @@ class ActionCallerTestCase(unittest.TestCase):
af = SCons.Action.ActionFactory(GlobalFunc, strfunc)
ac = SCons.Action.ActionCaller(af, [], {})
c = ac.get_contents([], [], Environment())
- assert c in matches, "C [%s] not in matches [%s]"%(repr(c),matches)
+ assert c in matches, "Got\n"+repr(c)+"\nExpected one of \n"+"\n".join([repr(f) for f in matches])
af = SCons.Action.ActionFactory(LocalFunc, strfunc)
ac = SCons.Action.ActionCaller(af, [], {})
c = ac.get_contents([], [], Environment())
- assert c in matches, repr(c)
+ assert c in matches, "Got\n"+repr(c)+"\nExpected one of \n"+"\n".join([repr(f) for f in matches])
matches = [
b'd\000\000S',
@@ -2044,7 +2044,8 @@ class ObjectContentsTestCase(unittest.TestCase):
return a
c = SCons.Action._function_contents(func1)
- assert bytearray('3, 3, 0, 0,(),(),(|\x00\x00S),(),()','utf-8') == c, repr(c)
+ expected = bytearray('3, 3, 0, 0,(),(),(|\x00\x00S),(),()','utf-8')
+ assert expected == c, "Got\n"+repr(c)+"\nExpected \n"+repr(expected)+"\n"
@unittest.skip("Results vary between py2 and py3, not sure if test makes sense to implement")