diff --git a/test/test_bihash.py b/test/test_bihash.py
index 32eb4ff..b57485a 100644
--- a/test/test_bihash.py
+++ b/test/test_bihash.py
@@ -8,7 +8,7 @@
 
 
 class TestBihash(VppTestCase):
-    """ Bihash Test Cases """
+    """Bihash Test Cases"""
 
     @classmethod
     def setUpClass(cls):
@@ -28,48 +28,54 @@
         super(TestBihash, self).tearDown()
 
     def test_bihash_unittest(self):
-        """ Bihash Add/Del Test """
+        """Bihash Add/Del Test"""
         error = self.vapi.cli("test bihash careful 0 verbose 0")
 
         if error:
             self.logger.critical(error)
-            self.assertNotIn('failed', error)
+            self.assertNotIn("failed", error)
 
     def test_bihash_thread(self):
-        """ Bihash Thread Test """
+        """Bihash Thread Test"""
 
-        error = self.vapi.cli("test bihash threads 2 nbuckets" +
-                              " 64000 careful 0 verbose 0")
+        error = self.vapi.cli(
+            "test bihash threads 2 nbuckets" + " 64000 careful 0 verbose 0"
+        )
 
         if error:
             self.logger.critical(error)
-            self.assertNotIn('failed', error)
+            self.assertNotIn("failed", error)
 
     def test_bihash_vec64(self):
-        """ Bihash vec64 Test """
+        """Bihash vec64 Test"""
 
         error = self.vapi.cli("test bihash vec64")
 
         if error:
             self.logger.critical(error)
-            self.assertNotIn('failed', error)
+            self.assertNotIn("failed", error)
 
     @unittest.skipUnless(config.gcov, "part of code coverage tests")
     def test_bihash_coverage(self):
-        """ Improve Code Coverage """
+        """Improve Code Coverage"""
 
-        error = self.vapi.cli("test bihash nitems 10 ncycles 3" +
-                              "search 2 careful 1 verbose 2 non-random-keys")
+        error = self.vapi.cli(
+            "test bihash nitems 10 ncycles 3"
+            + "search 2 careful 1 verbose 2 non-random-keys"
+        )
 
         if error:
             self.logger.critical(error)
-            self.assertNotIn('failed', error)
+            self.assertNotIn("failed", error)
 
-        error = self.vapi.cli("test bihash nitems 10 nbuckets 1 ncycles 3" +
-                              "search 2 careful 1 verbose 2 non-random-keys")
+        error = self.vapi.cli(
+            "test bihash nitems 10 nbuckets 1 ncycles 3"
+            + "search 2 careful 1 verbose 2 non-random-keys"
+        )
         if error:
             self.logger.critical(error)
-            self.assertNotIn('failed', error)
+            self.assertNotIn("failed", error)
 
-if __name__ == '__main__':
+
+if __name__ == "__main__":
     unittest.main(testRunner=VppTestRunner)
