Skip to content

Commit

Permalink
add regression test for #16454
Browse files Browse the repository at this point in the history
  • Loading branch information
ikonst committed Dec 11, 2023
1 parent 8980c84 commit fcd3e0a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test-data/unit/check-dataclasses.test
Original file line number Diff line number Diff line change
Expand Up @@ -2544,3 +2544,18 @@ class Base:
class Child(Base):
y: int
[builtins fixtures/dataclasses.pyi]

[case testDataclassDisallowAny]
# flags: --disallow-any-explicit --disallow-any-decorated

from dataclasses import dataclass
from typing import Any

# Ensures that when Any-typed fields end up in synthetic functions,
# those functions are not flagged since there's nothing the user can do about that
@dataclass
class C:
a: Any # E: Explicit "Any" is not allowed

[typing fixtures/typing-full.pyi]
[builtins fixtures/dataclasses.pyi]

0 comments on commit fcd3e0a

Please sign in to comment.