From 8537235d36287f78de0f47a47f4fe6caba263320 Mon Sep 17 00:00:00 2001 From: Viicos <65306057+Viicos@users.noreply.github.com> Date: Fri, 24 May 2024 10:04:49 +0200 Subject: [PATCH] type ignore comments compatibility between pyright and mypy --- .github/workflows/test.yml | 3 +-- tests/assert_type/db/models/check_enums.py | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1c11636f65..4ea7d82e57 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,8 +70,7 @@ jobs: - name: Run pytest tests run: PYTHONPATH='.' pytest --num-shards=4 --shard-id=${{ matrix.shard }} tests - name: Run mypy on the test cases - # TODO: When mypy aligns with pyright, remove the `--no-warn-unused-ignores`. - run: mypy tests/assert_type --no-warn-unused-ignores + run: mypy tests/assert_type stubtest: timeout-minutes: 10 diff --git a/tests/assert_type/db/models/check_enums.py b/tests/assert_type/db/models/check_enums.py index 5282e5449b..2c88d76f5a 100644 --- a/tests/assert_type/db/models/check_enums.py +++ b/tests/assert_type/db/models/check_enums.py @@ -8,9 +8,9 @@ class MyIntegerChoices(IntegerChoices): A = 1 B = 2, "B" - C = 3, "B", "..." # type: ignore + C = 3, "B", "..." # pyright: ignore[reportCallIssue] D = 4, _("D") - E = 5, 1 # type: ignore + E = 5, 1 # pyright: ignore[reportArgumentType] F = "1" @@ -29,8 +29,8 @@ class MyTextChoices(TextChoices): A = "a" B = "b", "B" C = "c", _("C") - D = 1 # type: ignore - E = "e", 1 # type: ignore + D = 1 # pyright: ignore[reportArgumentType] + E = "e", 1 # pyright: ignore[reportArgumentType] assert_type(MyTextChoices.A, Literal[MyTextChoices.A])