Conversation
a4574ae to
3ffb7a9
Compare
|
@Flamefire merge conflicts to resolve here... |
77d9d21 to
7e75f03
Compare
|
Rebased |
|
merge conflicts again... As with #5223, I think it would help to break this into smaller PRs, which are easier to review/merge, and less likely to get blocked by merge conflicts |
685f39a to
8b56b62
Compare
|
This is a search&replace (using regex) which I think is better to do once, especially as it is only test code so mistakes would a) turn up in CI and b) are not critical to users. So I would not recommend multiple PRs but just do some quick spot checking. If you still want separate PRs: How small do you want them? More PRs is more work but quicker to review. |
Point taken. It's just trouble to get this reviewed, since it keeps "bitrotting" in between times we manage to take another look at it, and leading to merge conflicts (as is again the case now). Naively I would say one PR per test module, but that's perhaps a step too far (that would be 25 tiny PRs). |
Ok done, all PRs mentioned in the description of this one. I'd keep this open in case at some point someone likes to merge the remaining changes in one go |
c0c4dad to
1e74993
Compare
188aa68 to
e2c076e
Compare
This makes the tests shorter and hence easier to read, avoids `re.compile` calls and manual failure message composing. In some cases `assert_multi_regex` could be used to avoid the explicit loops.
e2c076e to
0312736
Compare
|
All merged, no new occurrences in develop. Thanks! |
This PR is now split into smaller PRs (<= 5 modules, <= ~100 lines):
assert(Not)Regexinstead ofassertTrueorassertFalsein tests #5240assert(Not)Regexinstead ofassertTrueorassertFalsein tests #5241assert(Not)Regexinstead ofassertTrueorassertFalsein tests #5242assert(Not)Regexinstead ofassertTrueorassertFalsein tests #5243assert(Not)Regexinstead ofassertTrueorassertFalsein tests #5244assert(Not)Regexinstead ofassertTrueorassertFalsein tests #5245assert(Not)Regexinstead ofassertTrueorassertFalsein tests #5246assert(Not)Regexinstead ofassertTrueorassertFalsein tests #5247This makes the tests shorter and hence easier to read, avoids
re.compilecalls and manual failure message composing.In some cases
assert_multi_regexcould be used to avoid the explicit loops.While doing that I put the
re.compileinto the assertion instead of assigning to a variable and remove the call when there are no flags required asassertRegexaccepts strings or compiled expressionsExamples:
Continuation of #4205 , #4170, #5134 to remove usage of
assertTrue&assertFalseas for almost everything there is a better alternativeAlso regex assertions are over-used. In some places
assertInor evenassertEqualcould be used which is clearer and faster.However the replacements done here were mostly regex-based with lot's of manual inspection to find good patterns, and finding those where
assertInwould work is even more difficult.