This is an archive of the discontinued Mercurial Phabricator instance.

run-tests: extract sorting of tests to own function
ClosedPublic

Authored by indygreg on Dec 22 2017, 3:01 PM.

Details

Summary

TestRunner._run() is a large function and is difficult to follow.
Let's extract the test sorting to its own function to make it shorter.

When I refactored run-tests.py several years ago, I put a lot of
functionality in methods. The prevailing Mercurial style is to use
functions - not classes - where possible. While refactoring the code,
I decided to undo this historical mistake of mine by moving the code
to a standalone function.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Dec 22 2017, 3:01 PM
quark added a subscriber: quark.Dec 22 2017, 3:45 PM
quark added inline comments.
tests/run-tests.py
2271

I prefer the name testdescs since they are "test descriptions", not the real test objects. I think I renamed tests to testdescs intentionally.

indygreg updated this revision to Diff 4591.Dec 22 2017, 8:05 PM
yuja accepted this revision.Dec 22 2017, 8:39 PM
This revision is now accepted and ready to land.Dec 22 2017, 8:39 PM
This revision was automatically updated to reflect the committed changes.