linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Vincent Fazio <vfazio@xes-inc.com>
Cc: linux-gpio@vger.kernel.org, vfazio@gmail.com
Subject: Re: [libgpiod][PATCH 20/22] bindings: python: tests: annotate internal members
Date: Tue, 8 Oct 2024 15:34:44 +0200	[thread overview]
Message-ID: <CAMRc=Mdu+5k1TSUc3OPZoh20EeL13RoLRznen5dKK0wnRxaKjw@mail.gmail.com> (raw)
In-Reply-To: <20240927-vfazio-mypy-v1-20-91a7c2e20884@xes-inc.com>

On Fri, Sep 27, 2024 at 8:57 PM Vincent Fazio <vfazio@xes-inc.com> wrote:
>
> Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>
> ---
>  bindings/python/tests/tests_chip.py       | 10 +++++++---
>  bindings/python/tests/tests_chip_info.py  | 13 ++++++++++---
>  bindings/python/tests/tests_edge_event.py | 11 +++++++++--
>  bindings/python/tests/tests_info_event.py | 30 +++++++++++++++++++++++++-----
>  bindings/python/tests/tests_line_info.py  | 13 +++++++++++--
>  5 files changed, 62 insertions(+), 15 deletions(-)
>
> diff --git a/bindings/python/tests/tests_chip.py b/bindings/python/tests/tests_chip.py
> index 89d5df4341eceefbc0eed9b880ac641caa682af5..b719f6ba402c962b3ba8029cef61ed28fd1a525a 100644
> --- a/bindings/python/tests/tests_chip.py
> +++ b/bindings/python/tests/tests_chip.py
> @@ -3,6 +3,7 @@
>
>  import errno
>  import os
> +from typing import Optional
>  from unittest import TestCase
>
>  import gpiod
> @@ -70,7 +71,7 @@ class ChipBooleanConversion(TestCase):
>
>  class ChipProperties(TestCase):
>      def setUp(self) -> None:
> -        self.sim = gpiosim.Chip()
> +        self.sim: Optional[gpiosim.Chip] = gpiosim.Chip()
>          self.chip = gpiod.Chip(self.sim.dev_path)
>
>      def tearDown(self) -> None:
> @@ -78,6 +79,7 @@ class ChipProperties(TestCase):
>          self.sim = None
>
>      def test_get_chip_path(self) -> None:
> +        assert self.sim

Please say in the commit message why this is needed because I don't
understand this line and others below.

Bart

  reply	other threads:[~2024-10-08 13:34 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-27 18:53 [libgpiod][PATCH 00/22] bindings: python: conform to mypy and ruff linter recommendations Vincent Fazio
2024-09-27 18:53 ` [libgpiod][PATCH 01/22] bindings: python: clean up imports and exports Vincent Fazio
2024-10-08 11:16   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 02/22] bindings: python: make internal a private submodule Vincent Fazio
2024-10-08 11:24   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 03/22] bindings: python: fix annotation of variable length tuples Vincent Fazio
2024-10-08 13:02   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 04/22] bindings: python: add missing method type annotations Vincent Fazio
2024-10-08 13:07   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 05/22] bindings: python: add type stubs for _ext Vincent Fazio
2024-10-08 13:08   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 06/22] bindings: python: annotate internal members of Chip Vincent Fazio
2024-10-08 13:09   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 07/22] bindings: python: fix Chip union-attr type errors Vincent Fazio
2024-10-08 13:16   ` Bartosz Golaszewski
2024-10-08 14:57     ` Vincent Fazio
2024-10-08 15:46       ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 08/22] bindings: python: annotate internal members of LineRequest Vincent Fazio
2024-10-08 13:17   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 09/22] bindings: python: fix LineRequest union-attr type errors Vincent Fazio
2024-10-08 13:18   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 10/22] bindings: python: convert lines to offsets in LineRequest Vincent Fazio
2024-10-08 13:19   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 11/22] bindings: python: cast return value of LineRequest.get_values Vincent Fazio
2024-10-08 13:20   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 12/22] bindings: python: raise exception type, not exception instance Vincent Fazio
2024-10-08 13:23   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 13/22] bindings: python: selectively use f-strings Vincent Fazio
2024-10-08 13:24   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 14/22] bindings: python: tests: fix duplicate test name Vincent Fazio
2024-10-08 13:25   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 15/22] bindings: python: tests: clean up imports and exports Vincent Fazio
2024-10-08 13:27   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 16/22] bindings: python: tests: make EventType private to prevent export Vincent Fazio
2024-10-08 13:29   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 17/22] bindings: python: tests: add type stubs for external modules Vincent Fazio
2024-10-08 13:30   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 18/22] bindings: python: tests: add missing type annotations Vincent Fazio
2024-10-08 13:32   ` Bartosz Golaszewski
2024-10-09 16:41     ` Vincent Fazio
2024-10-09 18:24       ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 19/22] bindings: python: tests: ignore purposeful type errors Vincent Fazio
2024-10-08 13:33   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 20/22] bindings: python: tests: annotate internal members Vincent Fazio
2024-10-08 13:34   ` Bartosz Golaszewski [this message]
2024-09-27 18:53 ` [libgpiod][PATCH 21/22] bindings: python: tests: use f-strings Vincent Fazio
2024-10-08 13:35   ` Bartosz Golaszewski
2024-09-27 18:53 ` [libgpiod][PATCH 22/22] bindings: python: configure and document dev dependencies Vincent Fazio
2024-10-08 13:35   ` Bartosz Golaszewski
2024-10-08 13:37 ` [libgpiod][PATCH 00/22] bindings: python: conform to mypy and ruff linter recommendations Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMRc=Mdu+5k1TSUc3OPZoh20EeL13RoLRznen5dKK0wnRxaKjw@mail.gmail.com' \
    --to=brgl@bgdev.pl \
    --cc=linux-gpio@vger.kernel.org \
    --cc=vfazio@gmail.com \
    --cc=vfazio@xes-inc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).