Skip to content

Commit

Permalink
type ignore comments compatibility between pyright and mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos committed May 24, 2024
1 parent c0f8cfd commit 8537235
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/assert_type/db/models/check_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand All @@ -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])
Expand Down

0 comments on commit 8537235

Please sign in to comment.