Removes use of with statement in tests.