Helper methods for setting up and tearing down test environments