diff --git a/test/esp/credentials_test.rb b/test/esp/credentials_test.rb
index <HASH>..<HASH> 100644
--- a/test/esp/credentials_test.rb
+++ b/test/esp/credentials_test.rb
@@ -4,13 +4,13 @@ module ESP
   class CredentialsTest < ActiveSupport::TestCase
     context ESP::Credentials do
       setup do
+        ESP::Credentials.access_key_id = nil
+        ESP::Credentials.secret_access_key = nil
         @original_access_key_id = ENV['ESP_ACCESS_KEY_ID']
         @original_secret_access_key = ENV['ESP_SECRET_ACCESS_KEY']
       end
 
       teardown do
-        ESP::Credentials.access_key_id = nil
-        ESP::Credentials.secret_access_key = nil
         ENV['ESP_ACCESS_KEY_ID'] = @original_access_key_id
         ENV['ESP_SECRET_ACCESS_KEY'] = @original_secret_access_key
       end
Putting the cart before the horse.