[libcamera-devel,v5,12/13] py: unittests.py: Fix type checker warnings
diff mbox series

Message ID 20230603075615.20663-13-tomi.valkeinen@ideasonboard.com
State Accepted
Headers show
Series
  • py: New python bindings event handling
Related show

Commit Message

Tomi Valkeinen June 3, 2023, 7:56 a.m. UTC
Fix type checker warnings by dropping unused imports and using _ for
variable names that are not used.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 test/py/unittests.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Laurent Pinchart June 4, 2023, 1:09 p.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Sat, Jun 03, 2023 at 10:56:14AM +0300, Tomi Valkeinen wrote:
> Fix type checker warnings by dropping unused imports and using _ for
> variable names that are not used.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

As this is a fix, I'll move it to the bottom of the series and apply it
already.

> ---
>  test/py/unittests.py | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/test/py/unittests.py b/test/py/unittests.py
> index 024d9752..967e791f 100755
> --- a/test/py/unittests.py
> +++ b/test/py/unittests.py
> @@ -4,11 +4,9 @@
>  # Copyright (C) 2022, Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>  
>  from collections import defaultdict
> -import errno
>  import gc
>  import libcamera as libcam
>  import selectors
> -import time
>  import typing
>  import unittest
>  import weakref
> @@ -410,7 +408,7 @@ class SimpleCaptureMethods(CameraTesterBase):
>          running = True
>          while running:
>              events = sel.select()
> -            for key, _ in events:
> +            for _ in events:
>                  for ev in cm.get_events():
>                      self.assertEqual(ev.type, libcam.Event.Type.RequestCompleted)
>                      reqs.append(ev.request)
Tomi Valkeinen June 4, 2023, 1:15 p.m. UTC | #2
On 04/06/2023 16:09, Laurent Pinchart wrote:
> Hi Tomi,
> 
> Thank you for the patch.
> 
> On Sat, Jun 03, 2023 at 10:56:14AM +0300, Tomi Valkeinen wrote:
>> Fix type checker warnings by dropping unused imports and using _ for
>> variable names that are not used.
>>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> As this is a fix, I'll move it to the bottom of the series and apply it
> already.

It probably conflicts with the event change patches, and it doesn't fix 
any functionality. So, up to you, but possibly not worth reordering.

  Tomi

>> ---
>>   test/py/unittests.py | 4 +---
>>   1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/test/py/unittests.py b/test/py/unittests.py
>> index 024d9752..967e791f 100755
>> --- a/test/py/unittests.py
>> +++ b/test/py/unittests.py
>> @@ -4,11 +4,9 @@
>>   # Copyright (C) 2022, Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>   
>>   from collections import defaultdict
>> -import errno
>>   import gc
>>   import libcamera as libcam
>>   import selectors
>> -import time
>>   import typing
>>   import unittest
>>   import weakref
>> @@ -410,7 +408,7 @@ class SimpleCaptureMethods(CameraTesterBase):
>>           running = True
>>           while running:
>>               events = sel.select()
>> -            for key, _ in events:
>> +            for _ in events:
>>                   for ev in cm.get_events():
>>                       self.assertEqual(ev.type, libcam.Event.Type.RequestCompleted)
>>                       reqs.append(ev.request)
>

Patch
diff mbox series

diff --git a/test/py/unittests.py b/test/py/unittests.py
index 024d9752..967e791f 100755
--- a/test/py/unittests.py
+++ b/test/py/unittests.py
@@ -4,11 +4,9 @@ 
 # Copyright (C) 2022, Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
 
 from collections import defaultdict
-import errno
 import gc
 import libcamera as libcam
 import selectors
-import time
 import typing
 import unittest
 import weakref
@@ -410,7 +408,7 @@  class SimpleCaptureMethods(CameraTesterBase):
         running = True
         while running:
             events = sel.select()
-            for key, _ in events:
+            for _ in events:
                 for ev in cm.get_events():
                     self.assertEqual(ev.type, libcam.Event.Type.RequestCompleted)
                     reqs.append(ev.request)