Skip to content

Commit 4fa68c5

Browse files
committed
Fix ASYNC126 eval file after auto-formatter wrapping
The pre-commit ruff/black formatter wrapped some `class Foo(Bar):` lines across multiple lines, which moved the trailing `# error:` annotation off the line where the visitor actually emits the error (the `class` keyword line). Use shorter class names so the formatter leaves them on a single line.
1 parent 22f9ba8 commit 4fa68c5

1 file changed

Lines changed: 15 additions & 21 deletions

File tree

tests/eval_files/async126.py

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,25 @@ class NoDerive(ExceptionGroup): # error: 0, "NoDerive", "NoDerive"
88
pass
99

1010

11-
class NoDeriveBase(BaseExceptionGroup): # error: 0, "NoDeriveBase", "NoDeriveBase"
11+
class NoDeriveBE(BaseExceptionGroup): # error: 0, "NoDeriveBE", "NoDeriveBE"
1212
pass
1313

1414

15-
class NoDeriveGeneric(
16-
ExceptionGroup[Exception]
17-
): # error: 0, "NoDeriveGeneric", "NoDeriveGeneric"
15+
class NoDeriveG(ExceptionGroup[Exception]): # error: 0, "NoDeriveG", "NoDeriveG"
1816
pass
1917

2018

21-
import exceptiongroup
19+
import exceptiongroup as eg
2220

2321

24-
class NoDeriveQualified(
25-
exceptiongroup.ExceptionGroup
26-
): # error: 0, "NoDeriveQualified", "NoDeriveQualified"
22+
class NoDeriveQ(eg.ExceptionGroup): # error: 0, "NoDeriveQ", "NoDeriveQ"
2723
pass
2824

2925

30-
class SomeMixin: ...
26+
class _Mixin: ...
3127

3228

33-
class MultipleBases(
34-
SomeMixin, ExceptionGroup
35-
): # error: 0, "MultipleBases", "MultipleBases"
29+
class MultiBase(_Mixin, ExceptionGroup): # error: 0, "MultiBase", "MultiBase"
3630
pass
3731

3832

@@ -42,20 +36,20 @@ def derive(self, excs):
4236
return HasDerive(self.message, excs)
4337

4438

45-
class HasDeriveBase(BaseExceptionGroup):
39+
class HasDeriveBE(BaseExceptionGroup):
4640
def derive(self, excs):
47-
return HasDeriveBase(self.message, excs)
41+
return HasDeriveBE(self.message, excs)
4842

4943

50-
class HasDeriveGeneric(ExceptionGroup[Exception]):
44+
class HasDeriveG(ExceptionGroup[Exception]):
5145
def derive(self, excs):
52-
return HasDeriveGeneric(self.message, excs)
46+
return HasDeriveG(self.message, excs)
5347

5448

5549
# async derive is weird but counts
56-
class AsyncDerive(ExceptionGroup):
50+
class AsyncDer(ExceptionGroup):
5751
async def derive(self, excs): # type: ignore
58-
return AsyncDerive(self.message, excs)
52+
return AsyncDer(self.message, excs)
5953

6054

6155
# not an ExceptionGroup subclass
@@ -65,9 +59,9 @@ class NotAnEG(Exception):
6559

6660
# nested class
6761
class Outer:
68-
class InnerNoDerive(ExceptionGroup): # error: 4, "InnerNoDerive", "InnerNoDerive"
62+
class InnerNo(ExceptionGroup): # error: 4, "InnerNo", "InnerNo"
6963
pass
7064

71-
class InnerHasDerive(ExceptionGroup):
65+
class InnerHas(ExceptionGroup):
7266
def derive(self, excs):
73-
return Outer.InnerHasDerive(self.message, excs)
67+
return Outer.InnerHas(self.message, excs)

0 commit comments

Comments
 (0)