Mercurial > hg
diff tests/test-contrib-perf.t @ 42063:912d82daeda3
perf: make perf.run-limits code work with Python 3
We need b'' because perf.py isn't run through the source
transformer.
We need to cast the exception to bytes using pycompat.bytestr()
because ValueError can't be %s formatted due to built-in exceptions
lacking __bytes__.
We need to pycompat.sysstr() before the float() and int() cast
so the ValueError message doesn't have b'' in it.
Even with that, it looks like the error message for the ValueError
for float casts added quotes, so we need to account for that in test
output.
Differential Revision: https://phab.mercurial-scm.org/D6200
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 04 Apr 2019 17:47:25 -0700 |
parents | 4c700c847aa2 |
children | 563cd9a72682 |
line wrap: on
line diff
--- a/tests/test-contrib-perf.t Mon Dec 25 05:55:50 2017 -0800 +++ b/tests/test-contrib-perf.t Thu Apr 04 17:47:25 2019 -0700 @@ -260,7 +260,8 @@ malformatted run limit entry, missing "-": 500 ! wall * comb * user * sys * (best of 5) (glob) $ hg perfparents --config perf.stub=no --config perf.run-limits='aaa-12, 0.000000001-5' - malformatted run limit entry, could not convert string to float: aaa: aaa-12 + malformatted run limit entry, could not convert string to float: aaa: aaa-12 (no-py3 !) + malformatted run limit entry, could not convert string to float: 'aaa': aaa-12 (py3 !) ! wall * comb * user * sys * (best of 5) (glob) $ hg perfparents --config perf.stub=no --config perf.run-limits='12-aaaaaa, 0.000000001-5' malformatted run limit entry, invalid literal for int() with base 10: 'aaaaaa': 12-aaaaaa