cleanup: polyfill assertRaisesRegex so we can avoid assertRaisesRegexp
The latter is deprecated on Python 3.7 and causes our tests to fail
due to the warning.
Differential Revision: https://phab.mercurial-scm.org/D3375
To run the tests, do:
cd tests/
python run-tests.py
See https://mercurial-scm.org/wiki/WritingTests for
more information on writing tests.