diff --git a/acceptance/openstack/objectstorage/v1/accounts_test.go b/acceptance/openstack/objectstorage/v1/accounts_test.go
index 0cbee04..f7c01a7 100644
--- a/acceptance/openstack/objectstorage/v1/accounts_test.go
+++ b/acceptance/openstack/objectstorage/v1/accounts_test.go
@@ -16,8 +16,8 @@
 	client := newClient(t)
 
 	// Update an account's metadata.
-	res = accounts.Update(client, accounts.UpdateOpts{Metadata: metadata})
-	th.AssertNoErr(t, res.Err)
+	updateres := accounts.Update(client, accounts.UpdateOpts{Metadata: metadata})
+	th.AssertNoErr(t, updateres.Err)
 
 	// Defer the deletion of the metadata set above.
 	defer func() {
@@ -25,15 +25,16 @@
 		for k := range metadata {
 			tempMap[k] = ""
 		}
-		res = accounts.Update(client, accounts.UpdateOpts{Metadata: tempMap})
-		th.AssertNoErr(t, res.Err)
+		updateres = accounts.Update(client, accounts.UpdateOpts{Metadata: tempMap})
+		th.AssertNoErr(t, updateres.Err)
 	}()
 
 	// Retrieve account metadata.
-	res := accounts.Get(client, accounts.GetOpts{})
-	th.AssertNoErr(res.Err)
+	getres := accounts.Get(client, nil)
+	th.AssertNoErr(t, getres.Err)
 	// Extract the custom metadata from the 'Get' response.
-	am := accounts.ExtractMetadata(gr)
+	am, err := getres.ExtractMetadata()
+	th.AssertNoErr(t, err)
 	for k := range metadata {
 		if am[k] != metadata[strings.Title(k)] {
 			t.Errorf("Expected custom metadata with key: %s", k)
diff --git a/acceptance/openstack/objectstorage/v1/common.go b/acceptance/openstack/objectstorage/v1/common.go
index a91f9c7..1eac681 100644
--- a/acceptance/openstack/objectstorage/v1/common.go
+++ b/acceptance/openstack/objectstorage/v1/common.go
@@ -20,7 +20,9 @@
 	client, err := openstack.AuthenticatedClient(ao)
 	th.AssertNoErr(t, err)
 
-	return openstack.NewObjectStorageV1(client, gophercloud.EndpointOpts{
+	c, err := openstack.NewObjectStorageV1(client, gophercloud.EndpointOpts{
 		Region: os.Getenv("OS_REGION_NAME"),
 	})
+	th.AssertNoErr(t, err)
+	return c
 }
diff --git a/acceptance/openstack/objectstorage/v1/containers_test.go b/acceptance/openstack/objectstorage/v1/containers_test.go
index 8856941..d6832f1 100644
--- a/acceptance/openstack/objectstorage/v1/containers_test.go
+++ b/acceptance/openstack/objectstorage/v1/containers_test.go
@@ -28,21 +28,21 @@
 	// Create numContainers containers.
 	for i := 0; i < len(cNames); i++ {
 		res := containers.Create(client, cNames[i], nil)
-		th.AssertNoErr(res.Err)
+		th.AssertNoErr(t, res.Err)
 	}
 	// Delete the numContainers containers after function completion.
 	defer func() {
 		for i := 0; i < len(cNames); i++ {
-			res = containers.Delete(client, cNames[i])
-			th.AssertNoErr(res.Err)
+			res := containers.Delete(client, cNames[i])
+			th.AssertNoErr(t, res.Err)
 		}
 	}()
 
 	// List the numContainer names that were just created. To just list those,
 	// the 'prefix' parameter is used.
-	err = containers.List(client, &containers.ListOpts{Full: true, Prefix: "gophercloud-test-container-"}).EachPage(func(page pagination.Page) (bool, error) {
+	err := containers.List(client, &containers.ListOpts{Full: true, Prefix: "gophercloud-test-container-"}).EachPage(func(page pagination.Page) (bool, error) {
 		containerList, err := containers.ExtractInfo(page)
-		th.AssertNoErr(err)
+		th.AssertNoErr(t, err)
 
 		for _, n := range containerList {
 			t.Logf("Container: Name [%s] Count [%d] Bytes [%d]",
@@ -51,36 +51,36 @@
 
 		return true, nil
 	})
-	th.AssertNoErr(err)
+	th.AssertNoErr(t, err)
 
 	// List the info for the numContainer containers that were created.
 	err = containers.List(client, &containers.ListOpts{Full: false, Prefix: "gophercloud-test-container-"}).EachPage(func(page pagination.Page) (bool, error) {
 		containerList, err := containers.ExtractNames(page)
-		th.AssertNoErr(err)
+		th.AssertNoErr(t, err)
 		for _, n := range containerList {
 			t.Logf("Container: Name [%s]", n)
 		}
 
 		return true, nil
 	})
-	th.AssertNoErr(err)
+	th.AssertNoErr(t, err)
 
 	// Update one of the numContainer container metadata.
-	res = containers.Update(client, cNames[0], &containers.UpdateOpts{Metadata: metadata})
-	th.AssertNoErr(res.Err)
+	updateres := containers.Update(client, cNames[0], &containers.UpdateOpts{Metadata: metadata})
+	th.AssertNoErr(t, updateres.Err)
 	// After the tests are done, delete the metadata that was set.
 	defer func() {
 		tempMap := make(map[string]string)
 		for k := range metadata {
 			tempMap[k] = ""
 		}
-		res = containers.Update(client, cNames[0], &containers.UpdateOpts{Metadata: tempMap})
-		th.AssertNoErr(res.Err)
+		res := containers.Update(client, cNames[0], &containers.UpdateOpts{Metadata: tempMap})
+		th.AssertNoErr(t, res.Err)
 	}()
 
 	// Retrieve a container's metadata.
 	cm, err := containers.Get(client, cNames[0]).ExtractMetadata()
-	th.AssertNoErr(err)
+	th.AssertNoErr(t, err)
 	for k := range metadata {
 		if cm[k] != metadata[strings.Title(k)] {
 			t.Errorf("Expected custom metadata with key: %s", k)
diff --git a/acceptance/openstack/objectstorage/v1/objects_test.go b/acceptance/openstack/objectstorage/v1/objects_test.go
index 4c47367..987f733 100644
--- a/acceptance/openstack/objectstorage/v1/objects_test.go
+++ b/acceptance/openstack/objectstorage/v1/objects_test.go
@@ -20,7 +20,7 @@
 func TestObjects(t *testing.T) {
 	// Create a provider client for executing the HTTP request.
 	// See common.go for more information.
-	client := newClient()
+	client := newClient(t)
 
 	// Make a slice of length numObjects to hold the random object names.
 	oNames := make([]string, numObjects)
@@ -30,79 +30,71 @@
 
 	// Create a container to hold the test objects.
 	cName := tools.RandomString("test-container-", 8)
-	res = containers.Create(client, cName, nil)
-	th.AssertNoErr(res.Err)
+	createres := containers.Create(client, cName, nil)
+	th.AssertNoErr(t, createres.Err)
 
 	// Defer deletion of the container until after testing.
 	defer func() {
-		res = containers.Delete(client, cName)
-		th.AssertNoErr(res.Err)
+		res := containers.Delete(client, cName)
+		th.AssertNoErr(t, res.Err)
 	}()
 
 	// Create a slice of buffers to hold the test object content.
 	oContents := make([]*bytes.Buffer, numObjects)
 	for i := 0; i < numObjects; i++ {
 		oContents[i] = bytes.NewBuffer([]byte(tools.RandomString("", 10)))
-		res = objects.Create(client, cName, oNames[i], oContents[i], nil)
-		th.AssertNoErr(res.Err)
+		res := objects.Create(client, cName, oNames[i], oContents[i], nil)
+		th.AssertNoErr(t, res.Err)
 	}
 	// Delete the objects after testing.
 	defer func() {
 		for i := 0; i < numObjects; i++ {
-			res = objects.Delete(client, cName, oNames[i], nil)
+			res := objects.Delete(client, cName, oNames[i], nil)
+			th.AssertNoErr(t, res.Err)
 		}
 	}()
 
 	ons := make([]string, 0, len(oNames))
-	err = objects.List(client, cName, &objects.ListOpts{Full: false, Prefix: "test-object-"}).EachPage(func(page pagination.Page) (bool, error) {
+	err := objects.List(client, cName, &objects.ListOpts{Full: false, Prefix: "test-object-"}).EachPage(func(page pagination.Page) (bool, error) {
 		names, err := objects.ExtractNames(page)
-		th.AssertNoErr(err)
+		th.AssertNoErr(t, err)
 		ons = append(ons, names...)
 
 		return true, nil
 	})
-	th.AssertNoErr(err)
-	if len(ons) != len(oNames) {
-		t.Errorf("Expected %d names and got %d", len(oNames), len(ons))
-		return
-	}
+	th.AssertNoErr(t, err)
+	th.AssertEquals(t, len(ons), len(oNames))
 
 	ois := make([]objects.Object, 0, len(oNames))
 	err = objects.List(client, cName, &objects.ListOpts{Full: true, Prefix: "test-object-"}).EachPage(func(page pagination.Page) (bool, error) {
 		info, err := objects.ExtractInfo(page)
-		th.AssertNoErr(err)
+		th.AssertNoErr(t, err)
 
 		ois = append(ois, info...)
 
 		return true, nil
 	})
-	th.AssertNoErr(err)
-	if len(ois) != len(oNames) {
-		t.Errorf("Expected %d containers and got %d", len(oNames), len(ois))
-		return
-	}
+	th.AssertNoErr(t, err)
+	th.AssertEquals(t, len(ois), len(oNames))
 
 	// Copy the contents of one object to another.
-	res = objects.Copy(client, cName, oNames[0], &objects.CopyOpts{Destination: cName + "/" + oNames[1]})
-	th.AssertNoErr(res.Err)
+	copyres := objects.Copy(client, cName, oNames[0], &objects.CopyOpts{Destination: cName + "/" + oNames[1]})
+	th.AssertNoErr(t, copyres.Err)
 
 	// Download one of the objects that was created above.
 	o1Content, err := objects.Download(client, cName, oNames[0], nil).ExtractContent()
-	th.AssertNoErr(err)
+	th.AssertNoErr(t, err)
 
 	// Download the another object that was create above.
 	o2Content, err := objects.Download(client, cName, oNames[1], nil).ExtractContent()
-	th.AssertNoErr(err)
+	th.AssertNoErr(t, err)
 
 	// Compare the two object's contents to test that the copy worked.
-	if string(o2Content) != string(o1Content) {
-		t.Errorf("Copy failed. Expected\n%s\nand got\n%s", string(o1Content), string(o2Content))
-		return
-	}
+	th.AssertEquals(t, string(o2Content), string(o1Content))
 
 	// Update an object's metadata.
-	res = objects.Update(client, cName, oNames[0], &objects.UpdateOpts{Metadata: metadata})
-	th.AssertNoErr(res.Err)
+	updateres := objects.Update(client, cName, oNames[0], &objects.UpdateOpts{Metadata: metadata})
+	th.AssertNoErr(t, updateres.Err)
 
 	// Delete the object's metadata after testing.
 	defer func() {
@@ -110,13 +102,13 @@
 		for k := range metadata {
 			tempMap[k] = ""
 		}
-		res = objects.Update(client, cName, oNames[0], &objects.UpdateOpts{Metadata: tempMap})
-		th.AssertNoErr(res.Err)
+		res := objects.Update(client, cName, oNames[0], &objects.UpdateOpts{Metadata: tempMap})
+		th.AssertNoErr(t, res.Err)
 	}()
 
 	// Retrieve an object's metadata.
 	om, err := objects.Get(client, cName, oNames[0], nil).ExtractMetadata()
-	th.AssertNoErr(err)
+	th.AssertNoErr(t, err)
 	for k := range metadata {
 		if om[k] != metadata[strings.Title(k)] {
 			t.Errorf("Expected custom metadata with key: %s", k)
