Skip to content

Commit 6c20e7e

Browse files
authored
Update enum fixture to work with new analyzer and re-enable tests (python#6517)
1 parent 70565cd commit 6c20e7e

File tree

6 files changed

+3
-13
lines changed

6 files changed

+3
-13
lines changed

mypy/test/hacks.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
'check-classes.test',
1212
'check-custom-plugin.test',
1313
'check-dataclasses.test',
14-
'check-enum.test',
1514
'check-expressions.test',
1615
'check-flags.test',
1716
'check-functions.test',

test-data/unit/check-final.test

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -990,8 +990,6 @@ class D(A, B): # E: Cannot inherit from final class "B"
990990
[out]
991991

992992
[case testFinalCantOverrideWriteable]
993-
# flags: --no-new-semantic-analyzer
994-
# Properties with setters not yet supported.
995993
from typing import Any, Final, final
996994

997995
class B:

test-data/unit/check-inference.test

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,9 +1552,7 @@ def add():
15521552
map[1] = 2
15531553
[builtins fixtures/dict.pyi]
15541554

1555-
-- Depends on #6425
15561555
[case testSpecialCaseEmptyListInitialization]
1557-
# flags: --no-new-semantic-analyzer
15581556
def f(blocks: Any): # E: Name 'Any' is not defined
15591557
to_process = [] # E: Need type annotation for 'to_process'
15601558
to_process = list(blocks)

test-data/unit/fine-grained.test

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5169,9 +5169,7 @@ if int():
51695169
==
51705170
aa.py:5: error: Incompatible types in assignment (expression has type "int", variable has type "C")
51715171

5172-
-- Depends on #6289
51735172
[case testClassBasedEnumPropagation1]
5174-
# flags: --no-new-semantic-analyzer
51755173
import a
51765174
[file a.py]
51775175
from b import C
@@ -5270,9 +5268,7 @@ n = c
52705268
==
52715269
aa.py:5: error: Incompatible types in assignment (expression has type "int", variable has type "C")
52725270

5273-
-- Depends on #6289
52745271
[case testFuncBasedEnumPropagation1]
5275-
# flags: --no-new-semantic-analyzer
52765272
import a
52775273
[file a.py]
52785274
from b import C

test-data/unit/lib-stub/enum.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from typing import Any, TypeVar, Union, Type, Sized, Iterator, Mapping
1+
from typing import Any, TypeVar, Union, Type, Sized, Iterator
22

33
_T = TypeVar('_T')
44

55
class EnumMeta(type, Sized):
6+
def __len__(self) -> int: pass # to make it non-abstract
67
def __iter__(self: Type[_T]) -> Iterator[_T]: pass
78
def __reversed__(self: Type[_T]) -> Iterator[_T]: pass
89
def __getitem__(self: Type[_T], name: str) -> _T: pass

test-data/unit/semanal-errors.test

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -938,13 +938,11 @@ a[1], a[2] = None, None # type: int, int \
938938
[out]
939939

940940
[case testMissingGenericImport]
941-
# flags: --no-new-semantic-analyzer
942-
# This should be fixed by PR #6488
943941
from typing import TypeVar
944942
T = TypeVar('T')
945943
class A(Generic[T]): pass
946944
[out]
947-
main:5: error: Name 'Generic' is not defined
945+
main:3: error: Name 'Generic' is not defined
948946

949947
[case testInvalidTypeWithinGeneric]
950948
from typing import Generic

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy