Skip to content

Commit 48cda4f

Browse files
committed
Fix tests
1 parent aa539c1 commit 48cda4f

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

mypy/test/teststubtest.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,9 +1405,16 @@ def spam(x=Flags4(0)): pass
14051405
)
14061406
yield Case(
14071407
stub="""
1408+
import sys
14081409
from typing import Final, Literal
1409-
class BytesEnum(bytes, enum.Enum):
1410-
a = b'foo'
1410+
from typing_extensions import disjoint_base
1411+
if sys.version_info >= (3, 12):
1412+
class BytesEnum(bytes, enum.Enum):
1413+
a = b'foo'
1414+
else:
1415+
@disjoint_base
1416+
class BytesEnum(bytes, enum.Enum):
1417+
a = b'foo'
14111418
FOO: Literal[BytesEnum.a]
14121419
BAR: Final = BytesEnum.a
14131420
BAZ: BytesEnum

test-data/unit/check-classes.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6084,7 +6084,7 @@ class B(A):
60846084
__slots__ = ('a', 'b')
60856085
class C:
60866086
__slots__ = ('x',)
6087-
class D(B, C):
6087+
class D(B, C): # E: Class "D" has incompatible disjoint bases
60886088
__slots__ = ('aa', 'bb', 'cc')
60896089
[builtins fixtures/tuple.pyi]
60906090

test-data/unit/check-incremental.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3170,21 +3170,21 @@ C(5, 'foo', True)
31703170

31713171
[file a.py]
31723172
import attrs
3173-
@attrs.define
3173+
@attrs.define(slots=False)
31743174
class A:
31753175
a: int
31763176

31773177
[file b.py]
31783178
import attrs
3179-
@attrs.define
3179+
@attrs.define(slots=False)
31803180
class B:
31813181
b: str
31823182

31833183
[file c.py]
31843184
from a import A
31853185
from b import B
31863186
import attrs
3187-
@attrs.define
3187+
@attrs.define(slots=False)
31883188
class C(A, B):
31893189
c: bool
31903190

test-data/unit/check-slots.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ b.m = 2
180180
b.b = 2
181181
b._two = 2
182182
[out]
183+
main:5: error: Class "B" has incompatible disjoint bases
183184
main:11: error: Trying to assign name "_one" that is not in "__slots__" of type "__main__.B"
184185
main:16: error: "B" has no attribute "b"
185186
main:17: error: "B" has no attribute "_two"

0 commit comments

Comments
 (0)