Improve type annotations in Synapse's test suite.