diff --git a/resource_aws_s3_bucket_test.go b/resource_aws_s3_bucket_test.go
index <HASH>..<HASH> 100644
--- a/resource_aws_s3_bucket_test.go
+++ b/resource_aws_s3_bucket_test.go
@@ -645,14 +645,20 @@ func testAccCheckAWSS3BucketPolicy(n string, policy string) resource.TestCheckFu
 			Bucket: aws.String(rs.Primary.ID),
 		})
 
-		if err != nil {
-			if policy == "" {
+		if policy == "" {
+			if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NoSuchBucketPolicy" {
 				// expected
 				return nil
+			}
+			if err == nil {
+				return fmt.Errorf("Expected no policy, got: %#v", *out.Policy)
 			} else {
 				return fmt.Errorf("GetBucketPolicy error: %v, expected %s", err, policy)
 			}
 		}
+		if err != nil {
+			return fmt.Errorf("GetBucketPolicy error: %v, expected %s", err, policy)
+		}
 
 		if v := out.Policy; v == nil {
 			if policy != "" {
provider/aws: Fix s3_bucket test for empty policy