Move common test setup code to `test_helper`