Remove redundant code from tests.