diff --git a/tempest/api/compute/images/test_images.py b/tempest/api/compute/images/test_images.py
index ef33685..91ce1f9 100644
--- a/tempest/api/compute/images/test_images.py
+++ b/tempest/api/compute/images/test_images.py
@@ -25,6 +25,8 @@
 
 
 class ImagesTestJSON(base.BaseV2ComputeTest):
+    """Test server images"""
+
     create_default_network = True
 
     @classmethod
@@ -48,6 +50,7 @@
 
     @decorators.idempotent_id('aa06b52b-2db5-4807-b218-9441f75d74e3')
     def test_delete_saving_image(self):
+        """Test deleting server image while it is in 'SAVING' state"""
         server = self.create_test_server(wait_until='ACTIVE')
         self.addCleanup(self.servers_client.delete_server, server['id'])
         # wait for server active to avoid conflict when deleting server
@@ -74,6 +77,7 @@
 
     @decorators.idempotent_id('aaacd1d0-55a2-4ce8-818a-b5439df8adc9')
     def test_create_image_from_stopped_server(self):
+        """Test creating server image from stopped server"""
         server = self.create_test_server(wait_until='ACTIVE')
         self.servers_client.stop_server(server['id'])
         waiters.wait_for_server_status(self.servers_client,
@@ -91,6 +95,7 @@
     @testtools.skipUnless(CONF.compute_feature_enabled.pause,
                           'Pause is not available.')
     def test_create_image_from_paused_server(self):
+        """Test creating server image from paused server"""
         server = self.create_test_server(wait_until='ACTIVE')
         self.servers_client.pause_server(server['id'])
         waiters.wait_for_server_status(self.servers_client,
@@ -109,6 +114,7 @@
     @testtools.skipUnless(CONF.compute_feature_enabled.suspend,
                           'Suspend is not available.')
     def test_create_image_from_suspended_server(self):
+        """Test creating server image from suspended server"""
         server = self.create_test_server(wait_until='ACTIVE')
         self.servers_client.suspend_server(server['id'])
         waiters.wait_for_server_status(self.servers_client,
diff --git a/tempest/api/compute/images/test_images_negative.py b/tempest/api/compute/images/test_images_negative.py
index 2400348..5ff2a6a 100644
--- a/tempest/api/compute/images/test_images_negative.py
+++ b/tempest/api/compute/images/test_images_negative.py
@@ -42,11 +42,12 @@
 
 
 class ImagesNegativeTestJSON(ImagesNegativeTestBase):
+    """Negative tests of server image"""
 
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('6cd5a89d-5b47-46a7-93bc-3916f0d84973')
     def test_create_image_from_deleted_server(self):
-        # An image should not be created if the server instance is removed
+        """Check server image should not be created if the server is removed"""
         server = self.create_test_server(wait_until='ACTIVE')
 
         # Delete server before trying to create image
@@ -61,7 +62,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('82c5b0c4-9dbd-463c-872b-20c4755aae7f')
     def test_create_image_from_invalid_server(self):
-        # An image should not be created with invalid server id
+        """Check server image should not be created with invalid server id"""
         # Create a new image with invalid server id
         meta = {'image_type': 'test'}
         self.assertRaises(lib_exc.NotFound, self.create_image_from_server,
@@ -70,7 +71,10 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('ec176029-73dc-4037-8d72-2e4ff60cf538')
     def test_create_image_specify_uuid_35_characters_or_less(self):
-        # Return an error if Image ID passed is 35 characters or less
+        """Check server image should not be created for invalid server id
+
+        Return an error if server id passed is 35 characters or less
+        """
         snapshot_name = data_utils.rand_name('test-snap')
         test_uuid = ('a' * 35)
         self.assertRaises(lib_exc.NotFound, self.client.create_image,
@@ -79,7 +83,10 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('36741560-510e-4cc2-8641-55fe4dfb2437')
     def test_create_image_specify_uuid_37_characters_or_more(self):
-        # Return an error if Image ID passed is 37 characters or more
+        """Check server image should not be created for invalid server id
+
+        Return an error if sever id passed is 37 characters or more
+        """
         snapshot_name = data_utils.rand_name('test-snap')
         test_uuid = ('a' * 37)
         self.assertRaises(lib_exc.NotFound, self.client.create_image,
@@ -87,20 +94,23 @@
 
 
 class ImagesDeleteNegativeTestJSON(ImagesNegativeTestBase):
+    """Negative tests of server image
+
+    Negative tests of server image with compute microversion less than 2.36.
+    """
     max_microversion = '2.35'
 
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('381acb65-785a-4942-94ce-d8f8c84f1f0f')
     def test_delete_image_with_invalid_image_id(self):
-        # An image should not be deleted with invalid image id
+        """Check an image should not be deleted with invalid image id"""
         self.assertRaises(lib_exc.NotFound, self.client.delete_image,
                           data_utils.rand_name('invalid'))
 
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('137aef61-39f7-44a1-8ddf-0adf82511701')
     def test_delete_non_existent_image(self):
-        # Return an error while trying to delete a non-existent image
-
+        """Check trying to delete a non-existent image should fail"""
         non_existent_image_id = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound, self.client.delete_image,
                           non_existent_image_id)
@@ -108,13 +118,13 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('e6e41425-af5c-4fe6-a4b5-7b7b963ffda5')
     def test_delete_image_blank_id(self):
-        # Return an error while trying to delete an image with blank Id
+        """Check trying to delete an image with blank id should fail"""
         self.assertRaises(lib_exc.NotFound, self.client.delete_image, '')
 
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('924540c3-f1f1-444c-8f58-718958b6724e')
     def test_delete_image_non_hex_string_id(self):
-        # Return an error while trying to delete an image with non hex id
+        """Check trying to delete an image with non hex id should fail"""
         invalid_image_id = data_utils.rand_uuid()[:-1] + "j"
         self.assertRaises(lib_exc.NotFound, self.client.delete_image,
                           invalid_image_id)
@@ -122,13 +132,13 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('68e2c175-bd26-4407-ac0f-4ea9ce2139ea')
     def test_delete_image_negative_image_id(self):
-        # Return an error while trying to delete an image with negative id
+        """Check trying to delete an image with negative id should fail"""
         self.assertRaises(lib_exc.NotFound, self.client.delete_image, -1)
 
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('b340030d-82cd-4066-a314-c72fb7c59277')
     def test_delete_image_with_id_over_character_limit(self):
-        # Return an error while trying to delete image with id over limit
+        """Check trying to delete image with id over limit should fail"""
         invalid_image_id = data_utils.rand_uuid() + "1"
         self.assertRaises(lib_exc.NotFound, self.client.delete_image,
                           invalid_image_id)
diff --git a/tempest/api/compute/images/test_list_images.py b/tempest/api/compute/images/test_list_images.py
index cbb65bb..4dc23a7 100644
--- a/tempest/api/compute/images/test_list_images.py
+++ b/tempest/api/compute/images/test_list_images.py
@@ -21,6 +21,8 @@
 
 
 class ListImagesTestJSON(base.BaseV2ComputeTest):
+    """Test listing server images with compute microversion less than 2.36"""
+
     max_microversion = '2.35'
 
     @classmethod
@@ -37,20 +39,26 @@
 
     @decorators.idempotent_id('490d0898-e12a-463f-aef0-c50156b9f789')
     def test_get_image(self):
-        # Returns the correct details for a single image
+        """Test getting the correct details for a single server image"""
         image = self.client.show_image(self.image_ref)['image']
         self.assertEqual(self.image_ref, image['id'])
 
     @decorators.idempotent_id('fd51b7f4-d4a3-4331-9885-866658112a6f')
     def test_list_images(self):
-        # The list of all images should contain the image
+        """Test listing server images
+
+        The list of all images should contain the image
+        """
         images = self.client.list_images()['images']
         found = [i for i in images if i['id'] == self.image_ref]
         self.assertNotEmpty(found)
 
     @decorators.idempotent_id('9f94cb6b-7f10-48c5-b911-a0b84d7d4cd6')
     def test_list_images_with_detail(self):
-        # Detailed list of all images should contain the expected images
+        """Test listing server images with detail
+
+        Detailed list of all images should contain the expected images
+        """
         images = self.client.list_images(detail=True)['images']
         found = [i for i in images if i['id'] == self.image_ref]
         self.assertNotEmpty(found)
diff --git a/tempest/api/compute/limits/test_absolute_limits.py b/tempest/api/compute/limits/test_absolute_limits.py
index 8c2202e..c729069 100644
--- a/tempest/api/compute/limits/test_absolute_limits.py
+++ b/tempest/api/compute/limits/test_absolute_limits.py
@@ -18,6 +18,11 @@
 
 
 class AbsoluteLimitsTestJSON(base.BaseV2ComputeTest):
+    """Test compute absolute limits
+
+    Test compute absolute limits with compute microversion less than 2.57
+    """
+
     max_microversion = '2.56'
 
     @classmethod
@@ -27,12 +32,17 @@
 
     @decorators.idempotent_id('b54c66af-6ab6-4cf0-a9e5-a0cb58d75e0b')
     def test_absLimits_get(self):
+        """Test getting nova absolute limits"""
         # To check if all limits are present in the response (will be checked
         # by schema)
         self.client.show_limits()
 
 
 class AbsoluteLimitsV257TestJSON(base.BaseV2ComputeTest):
+    """Test compute absolute limits
+
+    Test compute absolute limits with compute microversion greater than 2.56
+    """
     min_microversion = '2.57'
     max_microversion = 'latest'
 
diff --git a/tempest/api/compute/limits/test_absolute_limits_negative.py b/tempest/api/compute/limits/test_absolute_limits_negative.py
index 500638a..de6a9b9 100644
--- a/tempest/api/compute/limits/test_absolute_limits_negative.py
+++ b/tempest/api/compute/limits/test_absolute_limits_negative.py
@@ -20,6 +20,7 @@
 
 
 class AbsoluteLimitsNegativeTestJSON(base.BaseV2ComputeTest):
+    """Negative tests of nova absolute limits"""
 
     def setUp(self):
         # NOTE(mriedem): Avoid conflicts with os-quota-class-sets tests.
@@ -34,7 +35,10 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('215cd465-d8ae-49c9-bf33-9c911913a5c8')
     def test_max_metadata_exceed_limit(self):
-        # We should not create vm with metadata over maxServerMeta limit
+        """Test creating server with metadata over limit should fail
+
+        We should not create server with metadata over maxServerMeta limit
+        """
         # Get max limit value
         limits = self.client.show_limits()['limits']
         max_meta = limits['absolute']['maxServerMeta']
diff --git a/tempest/api/compute/servers/test_delete_server.py b/tempest/api/compute/servers/test_delete_server.py
index a7db88a..ee25a22 100644
--- a/tempest/api/compute/servers/test_delete_server.py
+++ b/tempest/api/compute/servers/test_delete_server.py
@@ -26,6 +26,7 @@
 
 
 class DeleteServersTestJSON(base.BaseV2ComputeTest):
+    """Test deleting servers in various states"""
     create_default_network = True
 
     # NOTE: Server creations of each test class should be under 10
@@ -38,21 +39,21 @@
 
     @decorators.idempotent_id('9e6e0c87-3352-42f7-9faf-5d6210dbd159')
     def test_delete_server_while_in_building_state(self):
-        # Delete a server while it's VM state is Building
+        """Test deleting a server while it's VM state is Building"""
         server = self.create_test_server(wait_until='BUILD')
         self.client.delete_server(server['id'])
         waiters.wait_for_server_termination(self.client, server['id'])
 
     @decorators.idempotent_id('925fdfb4-5b13-47ea-ac8a-c36ae6fddb05')
     def test_delete_active_server(self):
-        # Delete a server while it's VM state is Active
+        """Test deleting a server while it's VM state is Active"""
         server = self.create_test_server(wait_until='ACTIVE')
         self.client.delete_server(server['id'])
         waiters.wait_for_server_termination(self.client, server['id'])
 
     @decorators.idempotent_id('546d368c-bb6c-4645-979a-83ed16f3a6be')
     def test_delete_server_while_in_shutoff_state(self):
-        # Delete a server while it's VM state is Shutoff
+        """Test deleting a server while it's VM state is Shutoff"""
         server = self.create_test_server(wait_until='ACTIVE')
         self.client.stop_server(server['id'])
         waiters.wait_for_server_status(self.client, server['id'], 'SHUTOFF')
@@ -63,7 +64,7 @@
     @testtools.skipUnless(CONF.compute_feature_enabled.pause,
                           'Pause is not available.')
     def test_delete_server_while_in_pause_state(self):
-        # Delete a server while it's VM state is Pause
+        """Test deleting a server while it's VM state is Pause"""
         server = self.create_test_server(wait_until='ACTIVE')
         self.client.pause_server(server['id'])
         waiters.wait_for_server_status(self.client, server['id'], 'PAUSED')
@@ -74,7 +75,7 @@
     @testtools.skipUnless(CONF.compute_feature_enabled.suspend,
                           'Suspend is not available.')
     def test_delete_server_while_in_suspended_state(self):
-        # Delete a server while it's VM state is Suspended
+        """Test deleting a server while it's VM state is Suspended"""
         server = self.create_test_server(wait_until='ACTIVE')
         self.client.suspend_server(server['id'])
         waiters.wait_for_server_status(self.client, server['id'], 'SUSPENDED')
@@ -85,7 +86,7 @@
     @testtools.skipUnless(CONF.compute_feature_enabled.shelve,
                           'Shelve is not available.')
     def test_delete_server_while_in_shelved_state(self):
-        # Delete a server while it's VM state is Shelved
+        """Test deleting a server while it's VM state is Shelved"""
         server = self.create_test_server(wait_until='ACTIVE')
         compute.shelve_server(self.client, server['id'])
 
@@ -96,7 +97,7 @@
     @testtools.skipIf(not CONF.compute_feature_enabled.resize,
                       'Resize not available.')
     def test_delete_server_while_in_verify_resize_state(self):
-        # Delete a server while it's VM state is VERIFY_RESIZE
+        """Test deleting a server while it's VM state is VERIFY_RESIZE"""
         server = self.create_test_server(wait_until='ACTIVE')
         self.client.resize_server(server['id'], self.flavor_ref_alt)
         waiters.wait_for_server_status(self.client, server['id'],
@@ -107,7 +108,7 @@
     @decorators.idempotent_id('d0f3f0d6-d9b6-4a32-8da4-23015dcab23c')
     @utils.services('volume')
     def test_delete_server_while_in_attached_volume(self):
-        # Delete a server while a volume is attached to it
+        """Test deleting a server while a volume is attached to it"""
         server = self.create_test_server(wait_until='ACTIVE')
 
         volume = self.create_volume()
diff --git a/tempest/api/compute/servers/test_server_group.py b/tempest/api/compute/servers/test_server_group.py
index 4b5efaa..4c0d021 100644
--- a/tempest/api/compute/servers/test_server_group.py
+++ b/tempest/api/compute/servers/test_server_group.py
@@ -82,18 +82,18 @@
 
     @decorators.idempotent_id('5dc57eda-35b7-4af7-9e5f-3c2be3d2d68b')
     def test_create_delete_server_group_with_affinity_policy(self):
-        # Create and Delete the server-group with affinity policy
+        """Test Create/Delete the server-group with affinity policy"""
         self._create_delete_server_group(self.policy)
 
     @decorators.idempotent_id('3645a102-372f-4140-afad-13698d850d23')
     def test_create_delete_server_group_with_anti_affinity_policy(self):
-        # Create and Delete the server-group with anti-affinity policy
+        """Test Create/Delete the server-group with anti-affinity policy"""
         policy = ['anti-affinity']
         self._create_delete_server_group(policy)
 
     @decorators.idempotent_id('154dc5a4-a2fe-44b5-b99e-f15806a4a113')
     def test_create_delete_multiple_server_groups_with_same_name_policy(self):
-        # Create and Delete the server-groups with same name and same policy
+        """Test Create/Delete the server-groups with same name and policy"""
         server_groups = []
         server_group_name = data_utils.rand_name('server-group')
         for _ in range(0, 2):
@@ -108,14 +108,14 @@
 
     @decorators.idempotent_id('b3545034-dd78-48f0-bdc2-a4adfa6d0ead')
     def test_show_server_group(self):
-        # Get the server-group
+        """Test getting the server-group detail"""
         body = self.client.show_server_group(
             self.created_server_group['id'])['server_group']
         self.assertEqual(self.created_server_group, body)
 
     @decorators.idempotent_id('d4874179-27b4-4d7d-80e4-6c560cdfe321')
     def test_list_server_groups(self):
-        # List the server-group
+        """Test listing the server-groups"""
         body = self.client.list_server_groups()['server_groups']
         self.assertIn(self.created_server_group, body)
 
@@ -124,7 +124,7 @@
         compute.is_scheduler_filter_enabled("ServerGroupAffinityFilter"),
         'ServerGroupAffinityFilter is not available.')
     def test_create_server_with_scheduler_hint_group(self):
-        # Create a server with the scheduler hint "group".
+        """Test creating a server with the scheduler hint 'group'"""
         hints = {'group': self.created_server_group['id']}
         server = self.create_test_server(scheduler_hints=hints,
                                          wait_until='ACTIVE')
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
index 7fa30b0..6676358 100644
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -30,6 +30,8 @@
 
 
 class ServersNegativeTestJSON(base.BaseV2ComputeTest):
+    """Negative tests of servers"""
+
     create_default_network = True
 
     def setUp(self):
@@ -66,8 +68,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('dbbfd247-c40c-449e-8f6c-d2aa7c7da7cf')
     def test_server_name_blank(self):
-        # Create a server with name parameter empty
-
+        """Creating a server with name parameter empty should fail"""
         self.assertRaises(lib_exc.BadRequest,
                           self.create_test_server,
                           name='')
@@ -77,8 +78,7 @@
     @testtools.skipUnless(CONF.compute_feature_enabled.personality,
                           'Nova personality feature disabled')
     def test_personality_file_contents_not_encoded(self):
-        # Use an unencoded file when creating a server with personality
-
+        """Using an unencoded injected file to create server should fail"""
         file_contents = 'This is a test file.'
         person = [{'path': '/etc/testfile.txt',
                    'contents': file_contents}]
@@ -90,8 +90,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('fcba1052-0a50-4cf3-b1ac-fae241edf02f')
     def test_create_with_invalid_image(self):
-        # Create a server with an unknown image
-
+        """Creating a server with an unknown image should fail"""
         self.assertRaises(lib_exc.BadRequest,
                           self.create_test_server,
                           image_id=-1)
@@ -99,8 +98,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('18f5227f-d155-4429-807c-ccb103887537')
     def test_create_with_invalid_flavor(self):
-        # Create a server with an unknown flavor
-
+        """Creating a server with an unknown flavor should fail"""
         self.assertRaises(lib_exc.BadRequest,
                           self.create_test_server,
                           flavor=-1,)
@@ -108,8 +106,10 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('7f70a4d1-608f-4794-9e56-cb182765972c')
     def test_invalid_access_ip_v4_address(self):
-        # An access IPv4 address must match a valid address pattern
+        """Creating a server with invalid ipv4 ip address should fail
 
+        An access IPv4 address must match a valid address pattern
+        """
         IPv4 = '1.1.1.1.1.1'
         self.assertRaises(lib_exc.BadRequest,
                           self.create_test_server, accessIPv4=IPv4)
@@ -117,8 +117,10 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('5226dd80-1e9c-4d8a-b5f9-b26ca4763fd0')
     def test_invalid_ip_v6_address(self):
-        # An access IPv6 address must match a valid address pattern
+        """Creating a server with invalid ipv6 ip address should fail
 
+        An access IPv6 address must match a valid address pattern
+        """
         IPv6 = 'notvalid'
 
         self.assertRaises(lib_exc.BadRequest,
@@ -129,7 +131,7 @@
                           'Resize not available.')
     @decorators.attr(type=['negative'])
     def test_resize_nonexistent_server(self):
-        # Resize a non-existent server
+        """Resizing a non-existent server should fail"""
         nonexistent_server = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound,
                           self.client.resize_server,
@@ -140,7 +142,7 @@
                           'Resize not available.')
     @decorators.attr(type=['negative'])
     def test_resize_server_with_non_existent_flavor(self):
-        # Resize a server with non-existent flavor
+        """Resizing a server with non existent flavor should fail"""
         nonexistent_flavor = data_utils.rand_uuid()
         self.assertRaises(lib_exc.BadRequest, self.client.resize_server,
                           self.server_id, flavor_ref=nonexistent_flavor)
@@ -150,14 +152,14 @@
                           'Resize not available.')
     @decorators.attr(type=['negative'])
     def test_resize_server_with_null_flavor(self):
-        # Resize a server with null flavor
+        """Resizing a server with null flavor should fail"""
         self.assertRaises(lib_exc.BadRequest, self.client.resize_server,
                           self.server_id, flavor_ref="")
 
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('d4c023a0-9c55-4747-9dd5-413b820143c7')
     def test_reboot_non_existent_server(self):
-        # Reboot a non existent server
+        """Rebooting a non existent server should fail"""
         nonexistent_server = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound, self.client.reboot_server,
                           nonexistent_server, type='SOFT')
@@ -167,7 +169,7 @@
                           'Pause is not available.')
     @decorators.attr(type=['negative'])
     def test_pause_paused_server(self):
-        # Pause a paused server.
+        """Pausing a paused server should fail"""
         self.client.pause_server(self.server_id)
         waiters.wait_for_server_status(self.client, self.server_id, 'PAUSED')
         self.assertRaises(lib_exc.Conflict,
@@ -178,7 +180,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('98fa0458-1485-440f-873b-fe7f0d714930')
     def test_rebuild_deleted_server(self):
-        # Rebuild a deleted server
+        """Rebuilding a deleted server should fail"""
         self.assertRaises(lib_exc.NotFound,
                           self.client.rebuild_server,
                           self.deleted_server_id, self.image_ref)
@@ -187,14 +189,14 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('581a397d-5eab-486f-9cf9-1014bbd4c984')
     def test_reboot_deleted_server(self):
-        # Reboot a deleted server
+        """Rebooting a deleted server should fail"""
         self.assertRaises(lib_exc.NotFound, self.client.reboot_server,
                           self.deleted_server_id, type='SOFT')
 
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('d86141a7-906e-4731-b187-d64a2ea61422')
     def test_rebuild_non_existent_server(self):
-        # Rebuild a non existent server
+        """Rebuilding a non existent server should fail"""
         nonexistent_server = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound,
                           self.client.rebuild_server,
@@ -204,6 +206,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('fd57f159-68d6-4c2a-902b-03070828a87e')
     def test_create_numeric_server_name(self):
+        """Creating a server with numeric server name should fail"""
         server_name = 12345
         self.assertRaises(lib_exc.BadRequest,
                           self.create_test_server,
@@ -212,8 +215,11 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('c3e0fb12-07fc-4d76-a22e-37409887afe8')
     def test_create_server_name_length_exceeds_256(self):
-        # Create a server with name length exceeding 255 characters
+        """Creating a server with name length exceeding limit should fail
 
+        Create a server with name length exceeding 255 characters, an error is
+        returned.
+        """
         server_name = 'a' * 256
         self.assertRaises(lib_exc.BadRequest,
                           self.create_test_server,
@@ -224,6 +230,11 @@
     @utils.services('volume')
     @decorators.idempotent_id('12146ac1-d7df-4928-ad25-b1f99e5286cd')
     def test_create_server_invalid_bdm_in_2nd_dict(self):
+        """Creating a server with invalid block_device_mapping_v2 should fail
+
+        Create a server with invalid block_device_mapping_v2, an error is
+        returned.
+        """
         volume = self.create_volume()
         bdm_1st = {"source_type": "image",
                    "delete_on_termination": True,
@@ -243,10 +254,9 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('4e72dc2d-44c5-4336-9667-f7972e95c402')
     def test_create_with_invalid_network_uuid(self):
+        """Creating a server with invalid network uuid should fail"""
         # Pass invalid network uuid while creating a server
-
         networks = [{'fixed_ip': '10.0.1.1', 'uuid': 'a-b-c-d-e-f-g-h-i-j'}]
-
         self.assertRaises(lib_exc.BadRequest,
                           self.create_test_server,
                           networks=networks)
@@ -254,8 +264,8 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('7a2efc39-530c-47de-b875-2dd01c8d39bd')
     def test_create_with_non_existent_keypair(self):
+        """Creating a server with non-existent keypair should fail"""
         # Pass a non-existent keypair while creating a server
-
         key_name = data_utils.rand_name('key')
         self.assertRaises(lib_exc.BadRequest,
                           self.create_test_server,
@@ -264,8 +274,8 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('7fc74810-0bd2-4cd7-8244-4f33a9db865a')
     def test_create_server_metadata_exceeds_length_limit(self):
+        """Creating a server with metadata longer than limit should fail """
         # Pass really long metadata while creating a server
-
         metadata = {'a': 'b' * 260}
         self.assertRaises((lib_exc.BadRequest, lib_exc.OverLimit),
                           self.create_test_server,
@@ -274,8 +284,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('aa8eed43-e2cb-4ebf-930b-da14f6a21d81')
     def test_update_name_of_non_existent_server(self):
-        # Update name of a non-existent server
-
+        """Updating name of a non-existent server should fail"""
         nonexistent_server = data_utils.rand_uuid()
         new_name = data_utils.rand_name(
             self.__class__.__name__ + '-server') + '_updated'
@@ -286,18 +295,19 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('38204696-17c6-44da-9590-40f87fb5a899')
     def test_update_server_set_empty_name(self):
-        # Update name of the server to an empty string
-
+        """Updating name of the server to an empty string should fail"""
         new_name = ''
-
         self.assertRaises(lib_exc.BadRequest, self.client.update_server,
                           self.server_id, name=new_name)
 
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('5c8e244c-dada-4590-9944-749c455b431f')
     def test_update_server_name_length_exceeds_256(self):
-        # Update name of server exceed the name length limit
+        """Updating name of server exceeding the name length limit should fail
 
+        Update name of server exceeding the name length limit, an error is
+        returned.
+        """
         new_name = 'a' * 256
         self.assertRaises(lib_exc.BadRequest,
                           self.client.update_server,
@@ -307,8 +317,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('1041b4e6-514b-4855-96a5-e974b60870a3')
     def test_delete_non_existent_server(self):
-        # Delete a non existent server
-
+        """Deleting a non existent server should fail"""
         nonexistent_server = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound, self.client.delete_server,
                           nonexistent_server)
@@ -316,23 +325,24 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('75f79124-277c-45e6-a373-a1d6803f4cc4')
     def test_delete_server_pass_negative_id(self):
-        # Pass an invalid string parameter to delete server
-
+        """Passing an invalid string parameter to delete server should fail"""
         self.assertRaises(lib_exc.NotFound, self.client.delete_server, -1)
 
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('f4d7279b-5fd2-4bf2-9ba4-ae35df0d18c5')
     def test_delete_server_pass_id_exceeding_length_limit(self):
-        # Pass a server ID that exceeds length limit to delete server
+        """Deleting server with a server ID exceeding length limit should fail
 
+        Pass a server ID that exceeds length limit to delete server, an error
+        is returned.
+        """
         self.assertRaises(lib_exc.NotFound, self.client.delete_server,
                           sys.maxsize + 1)
 
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('c5fa6041-80cd-483b-aa6d-4e45f19d093c')
     def test_create_with_nonexistent_security_group(self):
-        # Create a server with a nonexistent security group
-
+        """Creating a server with a nonexistent security group should fail"""
         security_groups = [{'name': 'does_not_exist'}]
         self.assertRaises(lib_exc.BadRequest,
                           self.create_test_server,
@@ -341,7 +351,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('3436b02f-1b1e-4f03-881e-c6a602327439')
     def test_get_non_existent_server(self):
-        # Get a non existent server details
+        """Getting a non existent server details should fail"""
         nonexistent_server = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound, self.client.show_server,
                           nonexistent_server)
@@ -349,7 +359,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('a31460a9-49e1-42aa-82ee-06e0bb7c2d03')
     def test_stop_non_existent_server(self):
-        # Stop a non existent server
+        """Stopping a non existent server should fail"""
         nonexistent_server = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound, self.servers_client.stop_server,
                           nonexistent_server)
@@ -359,7 +369,7 @@
                           'Pause is not available.')
     @decorators.attr(type=['negative'])
     def test_pause_non_existent_server(self):
-        # pause a non existent server
+        """Pausing a non existent server should fail"""
         nonexistent_server = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound, self.client.pause_server,
                           nonexistent_server)
@@ -369,7 +379,7 @@
                           'Pause is not available.')
     @decorators.attr(type=['negative'])
     def test_unpause_non_existent_server(self):
-        # unpause a non existent server
+        """Unpausing a non existent server should fail"""
         nonexistent_server = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound, self.client.unpause_server,
                           nonexistent_server)
@@ -379,7 +389,7 @@
                           'Pause is not available.')
     @decorators.attr(type=['negative'])
     def test_unpause_server_invalid_state(self):
-        # unpause an active server.
+        """Unpausing an active server should fail"""
         self.assertRaises(lib_exc.Conflict,
                           self.client.unpause_server,
                           self.server_id)
@@ -389,7 +399,7 @@
                           'Suspend is not available.')
     @decorators.attr(type=['negative'])
     def test_suspend_non_existent_server(self):
-        # suspend a non existent server
+        """Suspending a non existent server should fail"""
         nonexistent_server = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound, self.client.suspend_server,
                           nonexistent_server)
@@ -399,7 +409,7 @@
                           'Suspend is not available.')
     @decorators.attr(type=['negative'])
     def test_suspend_server_invalid_state(self):
-        # suspend a suspended server.
+        """Suspending a suspended server should fail"""
         self.client.suspend_server(self.server_id)
         waiters.wait_for_server_status(self.client, self.server_id,
                                        'SUSPENDED')
@@ -413,7 +423,7 @@
                           'Suspend is not available.')
     @decorators.attr(type=['negative'])
     def test_resume_non_existent_server(self):
-        # resume a non existent server
+        """Resuming a non existent server should fail"""
         nonexistent_server = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound, self.client.resume_server,
                           nonexistent_server)
@@ -423,7 +433,7 @@
                           'Suspend is not available.')
     @decorators.attr(type=['negative'])
     def test_resume_server_invalid_state(self):
-        # resume an active server.
+        """Resuming an active server should fail"""
         self.assertRaises(lib_exc.Conflict,
                           self.client.resume_server,
                           self.server_id)
@@ -431,7 +441,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('7dd919e7-413f-4198-bebb-35e2a01b13e9')
     def test_get_console_output_of_non_existent_server(self):
-        # get the console output for a non existent server
+        """Getting the console output for a non existent server should fail"""
         nonexistent_server = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound,
                           self.client.get_console_output,
@@ -440,7 +450,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('6f47992b-5144-4250-9f8b-f00aa33950f3')
     def test_force_delete_nonexistent_server_id(self):
-        # force-delete a non existent server
+        """Force-deleting a non existent server should fail"""
         nonexistent_server = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound,
                           self.client.force_delete_server,
@@ -449,7 +459,11 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('9c6d38cc-fcfb-437a-85b9-7b788af8bf01')
     def test_restore_nonexistent_server_id(self):
-        # restore-delete a non existent server
+        """Restore-deleting a non existent server should fail
+
+        We can restore a soft deleted server, but can't restore a non
+        existent server.
+        """
         nonexistent_server = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound,
                           self.client.restore_soft_deleted_server,
@@ -458,7 +472,11 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('7fcadfab-bd6a-4753-8db7-4a51e51aade9')
     def test_restore_server_invalid_state(self):
-        # we can only restore-delete a server in 'soft-delete' state
+        """Restore-deleting a server not in 'soft-delete' state should fail
+
+        We can restore a soft deleted server, but can't restore a server that
+        is not in 'soft-delete' state.
+        """
         self.assertRaises(lib_exc.Conflict,
                           self.client.restore_soft_deleted_server,
                           self.server_id)
@@ -468,7 +486,7 @@
                           'Shelve is not available.')
     @decorators.attr(type=['negative'])
     def test_shelve_non_existent_server(self):
-        # shelve a non existent server
+        """Shelving a non existent server should fail"""
         nonexistent_server = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound, self.client.shelve_server,
                           nonexistent_server)
@@ -478,7 +496,7 @@
                           'Shelve is not available.')
     @decorators.attr(type=['negative'])
     def test_shelve_shelved_server(self):
-        # shelve a shelved server.
+        """Shelving a shelved server should fail"""
         compute.shelve_server(self.client, self.server_id)
 
         def _unshelve_server():
@@ -508,7 +526,7 @@
                           'Shelve is not available.')
     @decorators.attr(type=['negative'])
     def test_unshelve_non_existent_server(self):
-        # unshelve a non existent server
+        """Unshelving a non existent server should fail"""
         nonexistent_server = data_utils.rand_uuid()
         self.assertRaises(lib_exc.NotFound, self.client.unshelve_server,
                           nonexistent_server)
@@ -518,7 +536,7 @@
                           'Shelve is not available.')
     @decorators.attr(type=['negative'])
     def test_unshelve_server_invalid_state(self):
-        # unshelve an active server.
+        """Unshelving an active server should fail"""
         self.assertRaises(lib_exc.Conflict,
                           self.client.unshelve_server,
                           self.server_id)
@@ -527,7 +545,7 @@
     @decorators.idempotent_id('74085be3-a370-4ca2-bc51-2d0e10e0f573')
     @utils.services('volume', 'image')
     def test_create_server_from_non_bootable_volume(self):
-        # Create a volume
+        """Creating a server from a non bootable volume should fail"""
         volume = self.create_volume()
 
         # Update volume bootable status to false
@@ -555,6 +573,8 @@
 
 
 class ServersNegativeTestMultiTenantJSON(base.BaseV2ComputeTest):
+    """Negative tests of servers for multiple projects"""
+
     create_default_network = True
 
     credentials = ['primary', 'alt']
@@ -581,8 +601,11 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('543d84c1-dd2e-4c6d-8cb2-b9da0efaa384')
     def test_update_server_of_another_tenant(self):
-        # Update name of a server that belongs to another tenant
+        """Updating server that belongs to another project should fail
 
+        Update name of a server that belongs to another project, an error is
+        returned.
+        """
         new_name = self.server_id + '_new'
         self.assertRaises(lib_exc.NotFound,
                           self.alt_client.update_server, self.server_id,
@@ -591,7 +614,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('5c75009d-3eea-423e-bea3-61b09fd25f9c')
     def test_delete_a_server_of_another_tenant(self):
-        # Delete a server that belongs to another tenant
+        """Deleting a server that belongs to another project should fail"""
         self.assertRaises(lib_exc.NotFound,
                           self.alt_client.delete_server,
                           self.server_id)
diff --git a/tempest/api/compute/volumes/test_attach_volume.py b/tempest/api/compute/volumes/test_attach_volume.py
index 97813a5..d85e4f7 100644
--- a/tempest/api/compute/volumes/test_attach_volume.py
+++ b/tempest/api/compute/volumes/test_attach_volume.py
@@ -59,13 +59,17 @@
 
 
 class AttachVolumeTestJSON(BaseAttachVolumeTest):
+    """Test attaching volume to server"""
 
     @decorators.idempotent_id('52e9045a-e90d-4c0d-9087-79d657faffff')
     # This test is conditionally marked slow if SSH validation is enabled.
     @decorators.attr(type='slow', condition=CONF.validation.run_validation)
     def test_attach_detach_volume(self):
-        # Stop and Start a server with an attached volume, ensuring that
-        # the volume remains attached.
+        """Test attaching and detaching volume from server
+
+        Stop and Start a server with an attached volume, ensuring that
+        the volume remains attached.
+        """
         server, validation_resources = self._create_server()
 
         # NOTE(andreaf) Create one remote client used throughout the test.
@@ -125,6 +129,13 @@
 
     @decorators.idempotent_id('7fa563fe-f0f7-43eb-9e22-a1ece036b513')
     def test_list_get_volume_attachments(self):
+        """Test listing and getting volume attachments
+
+        First we attach one volume to the server, check listing and getting
+        the volume attachment of the server. Then we attach another volume to
+        the server, check listing and getting the volume attachments of the
+        server. Finally we detach the volumes from the server one by one.
+        """
         # List volume attachment of the server
         server, validation_resources = self._create_server()
         volume_1st = self.create_volume()
@@ -244,8 +255,12 @@
     @decorators.attr(type='slow')
     @decorators.idempotent_id('13a940b6-3474-4c3c-b03f-29b89112bfee')
     def test_attach_volume_shelved_or_offload_server(self):
-        # Create server, count number of volumes on it, shelve
-        # server and attach pre-created volume to shelved server
+        """Test attaching volume to shelved server
+
+        Create server, count number of volumes on it, shelve
+        server and attach pre-created volume to shelved server, then
+        unshelve the server and check that attached volume exists.
+        """
         server, validation_resources = self._create_server()
         volume = self.create_volume()
         num_vol = self._count_volumes(server, validation_resources)
@@ -271,8 +286,12 @@
     @decorators.attr(type='slow')
     @decorators.idempotent_id('b54e86dd-a070-49c4-9c07-59ae6dae15aa')
     def test_detach_volume_shelved_or_offload_server(self):
-        # Count number of volumes on instance, shelve
-        # server and attach pre-created volume to shelved server
+        """Test detaching volume from shelved server
+
+        Count number of volumes on server, shelve server and attach
+        pre-created volume to shelved server, then detach the volume, unshelve
+        the instance and check that we have the expected number of volume(s).
+        """
         server, validation_resources = self._create_server()
         volume = self.create_volume()
         num_vol = self._count_volumes(server, validation_resources)
@@ -291,6 +310,12 @@
 
 
 class AttachVolumeMultiAttachTest(BaseAttachVolumeTest):
+    """Test attaching one volume to multiple servers
+
+    Test attaching one volume to multiple servers with compute
+    microversion greater than 2.59.
+    """
+
     min_microversion = '2.60'
     max_microversion = 'latest'
 
@@ -367,6 +392,12 @@
 
     @decorators.idempotent_id('8d5853f7-56e7-4988-9b0c-48cea3c7049a')
     def test_list_get_volume_attachments_multiattach(self):
+        """Test listing and getting multiattached volume attachments
+
+        Attach a single volume to two servers, list attachments from the
+        volume and make sure the server uuids are in the list, then detach
+        the volume from servers one by one.
+        """
         # Attach a single volume to two servers.
         servers, volume, attachments = self._create_and_multiattach()
 
@@ -448,7 +479,10 @@
     @testtools.skipUnless(CONF.compute_feature_enabled.resize,
                           'Resize not available.')
     def test_resize_server_with_multiattached_volume(self):
-        # Attach a single volume to multiple servers, then resize the servers
+        """Test resizing servers with multiattached volume
+
+        Attach a single volume to multiple servers, then resize the servers
+        """
         servers, volume, _ = self._create_and_multiattach()
 
         for server in servers:
diff --git a/tempest/api/volume/test_volumes_list.py b/tempest/api/volume/test_volumes_list.py
index 2345698..60f85a4 100644
--- a/tempest/api/volume/test_volumes_list.py
+++ b/tempest/api/volume/test_volumes_list.py
@@ -26,11 +26,14 @@
 
 
 class VolumesListTestJSON(base.BaseVolumeTest):
-    # NOTE: This test creates a number of 1G volumes. To run it successfully,
-    # ensure that the backing file for the volume group that Cinder uses
-    # has space for at least 3 1G volumes!
-    # If you are running a Devstack environment, ensure that the
-    # VOLUME_BACKING_FILE_SIZE is at least 4G in your localrc
+    """Test listing volumes
+
+    NOTE: This test creates a number of 1G volumes. To run it successfully,
+    ensure that the backing file for the volume group that Cinder uses
+    has space for at least 3 1G volumes!
+    If you are running a Devstack environment, ensure that the
+    VOLUME_BACKING_FILE_SIZE is at least 4G in your localrc
+    """
 
     VOLUME_FIELDS = ('id', 'name')
 
@@ -116,7 +119,7 @@
     @decorators.attr(type='smoke')
     @decorators.idempotent_id('0b6ddd39-b948-471f-8038-4787978747c4')
     def test_volume_list(self):
-        # Get a list of Volumes
+        """Test getting a list of volumes"""
         # Fetch all volumes
         fetched_list = self.volumes_client.list_volumes()['volumes']
         self._assert_volumes_in(fetched_list, self.volume_list,
@@ -124,13 +127,14 @@
 
     @decorators.idempotent_id('adcbb5a7-5ad8-4b61-bd10-5380e111a877')
     def test_volume_list_with_details(self):
-        # Get a list of Volumes with details
+        """Test getting a list of detailed volumes"""
         # Fetch all Volumes
         fetched_list = self.volumes_client.list_volumes(detail=True)['volumes']
         self._assert_volumes_in(fetched_list, self.volume_list)
 
     @decorators.idempotent_id('a28e8da4-0b56-472f-87a8-0f4d3f819c02')
     def test_volume_list_by_name(self):
+        """Test getting a list of volumes filtered by volume name"""
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
         params = {'name': volume['name']}
         fetched_vol = self.volumes_client.list_volumes(
@@ -140,6 +144,7 @@
 
     @decorators.idempotent_id('2de3a6d4-12aa-403b-a8f2-fdeb42a89623')
     def test_volume_list_details_by_name(self):
+        """Test getting a list of detailed volumes filtered by volume name"""
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
         params = {'name': volume['name']}
         fetched_vol = self.volumes_client.list_volumes(
@@ -149,6 +154,7 @@
 
     @decorators.idempotent_id('39654e13-734c-4dab-95ce-7613bf8407ce')
     def test_volumes_list_by_status(self):
+        """Test getting a list of volumes filtered by volume status"""
         params = {'status': 'available'}
         fetched_list = self.volumes_client.list_volumes(
             params=params)['volumes']
@@ -158,6 +164,7 @@
 
     @decorators.idempotent_id('2943f712-71ec-482a-bf49-d5ca06216b9f')
     def test_volumes_list_details_by_status(self):
+        """Test getting a list of detailed volumes filtered by status"""
         params = {'status': 'available'}
         fetched_list = self.volumes_client.list_volumes(
             detail=True, params=params)['volumes']
@@ -181,6 +188,7 @@
 
     @decorators.idempotent_id('2016a939-72ec-482a-bf49-d5ca06216b9f')
     def test_volumes_list_details_by_bootable(self):
+        """Test getting a list of detailed volumes filtered by bootable"""
         params = {'bootable': 'false'}
         fetched_list = self.volumes_client.list_volumes(
             detail=True, params=params)['volumes']
@@ -190,6 +198,7 @@
 
     @decorators.idempotent_id('c0cfa863-3020-40d7-b587-e35f597d5d87')
     def test_volumes_list_by_availability_zone(self):
+        """Test getting a list of volumes filtered by availability zone"""
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
         zone = volume['availability_zone']
         params = {'availability_zone': zone}
@@ -201,6 +210,7 @@
 
     @decorators.idempotent_id('e1b80d13-94f0-4ba2-a40e-386af29f8db1')
     def test_volumes_list_details_by_availability_zone(self):
+        """Test getting a list of detailed volumes by availability zone"""
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
         zone = volume['availability_zone']
         params = {'availability_zone': zone}
@@ -212,19 +222,19 @@
 
     @decorators.idempotent_id('b5ebea1b-0603-40a0-bb41-15fcd0a53214')
     def test_volume_list_with_param_metadata(self):
-        # Test to list volumes when metadata param is given
+        """Test listing volumes when metadata param is given"""
         params = {'metadata': self.metadata}
         self._list_by_param_value_and_assert(params)
 
     @decorators.idempotent_id('1ca92d3c-4a8e-4b43-93f5-e4c7fb3b291d')
     def test_volume_list_with_detail_param_metadata(self):
-        # Test to list volumes details when metadata param is given
+        """Test listing volumes details when metadata param is given"""
         params = {'metadata': self.metadata}
         self._list_by_param_value_and_assert(params, with_detail=True)
 
     @decorators.idempotent_id('777c87c1-2fc4-4883-8b8e-5c0b951d1ec8')
     def test_volume_list_param_display_name_and_status(self):
-        # Test to list volume when display name and status param is given
+        """Test listing volume when display name and status param is given"""
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
         params = {'name': volume['name'],
                   'status': 'available'}
@@ -232,7 +242,7 @@
 
     @decorators.idempotent_id('856ab8ca-6009-4c37-b691-be1065528ad4')
     def test_volume_list_with_detail_param_display_name_and_status(self):
-        # Test to list volume when name and status param is given
+        """Test listing volume when name and status param is given"""
         volume = self.volume_list[data_utils.rand_int_id(0, 2)]
         params = {'name': volume['name'],
                   'status': 'available'}
@@ -240,7 +250,7 @@
 
     @decorators.idempotent_id('2a7064eb-b9c3-429b-b888-33928fc5edd3')
     def test_volume_list_details_with_multiple_params(self):
-        # List volumes detail using combined condition
+        """Test listing volumes detail using combined filtering condition"""
         def _list_details_with_multiple_params(limit=2,
                                                status='available',
                                                sort_dir='asc',
@@ -375,14 +385,29 @@
 
     @decorators.idempotent_id('e9138a2c-f67b-4796-8efa-635c196d01de')
     def test_volume_list_details_pagination(self):
+        """Test listing volumes with details by pagination
+
+        All volumes will be returned by multiple requests, and the number of
+        'limit' volumes will be returned at a time.
+        """
         self._test_pagination('volumes', ids=self.volume_id_list, detail=True)
 
     @decorators.idempotent_id('af55e775-8e4b-4feb-8719-215c43b0238c')
     def test_volume_list_pagination(self):
+        """Test listing volumes by pagination
+
+        All volumes will be returned by multiple requests, and the number of
+        'limit' volumes will be returned at a time.
+        """
         self._test_pagination('volumes', ids=self.volume_id_list, detail=False)
 
     @decorators.idempotent_id('46eff077-100b-427f-914e-3db2abcdb7e2')
     def test_volume_list_with_detail_param_marker(self):
+        """Test listing volumes with details from the specified marker
+
+        Choose a volume id from all volumes as a marker, list volumes with
+        that marker, only volumes with id greater than marker will be returned.
+        """
         # Choosing a random volume from a list of volumes for 'marker'
         # parameter
         marker = random.choice(self.volume_id_list)
