tests: port inline extensions in test-hook.t to py3
This test *almost* passes now, but some import errors print very
differently in ways that seem at least somewhat important.
Differential Revision: https://phab.mercurial-scm.org/D3363
tests: manually print list in test-hook.t
Changes the output a bit, but not in an important way.
Differential Revision: https://phab.mercurial-scm.org/D3362