diff --git a/tests/components/zha/test_discover.py b/tests/components/zha/test_discover.py
index f9242eb1d961697ab90ff12889f29c9c52c24b2e..c32b9252f4dca1b4280428dbce4851a1d51a293f 100644
--- a/tests/components/zha/test_discover.py
+++ b/tests/components/zha/test_discover.py
@@ -1001,7 +1001,7 @@ async def test_quirks_v2_metadata_errors(
             # if the device was created we remove it
             # so we don't pollute the rest of the tests
             zigpy.quirks._DEVICE_REGISTRY.remove(zigpy_device)
-        except ValueError as e:
+        except ValueError:
             # if the device was not created we remove it
             # so we don't pollute the rest of the tests
             zigpy.quirks._DEVICE_REGISTRY._registry_v2.pop(
@@ -1010,7 +1010,7 @@ async def test_quirks_v2_metadata_errors(
                     "TRADFRI remote control4",
                 )
             )
-            raise e
+            raise
 
 
 class BadDeviceClass(enum.Enum):