Skip to content

Commit 1b24bf7

Browse files
authored
Update NoReturn imports in tests (#18529)
`mypy_extensions.NoReturn` has been redundant for a while now. With the next mypy_extensions release, it will raise a `DeprecationWarning` when imported. Replace existing imports in tests with `typing.NoReturn`.
1 parent 2348b8d commit 1b24bf7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test-data/unit/check-flags.test

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def f() -> int:
347347

348348
[case testNoReturnDisallowsReturn]
349349
# flags: --warn-no-return
350-
from mypy_extensions import NoReturn
350+
from typing import NoReturn
351351

352352
def f() -> NoReturn:
353353
if bool():
@@ -358,7 +358,7 @@ def f() -> NoReturn:
358358

359359
[case testNoReturnWithoutImplicitReturn]
360360
# flags: --warn-no-return
361-
from mypy_extensions import NoReturn
361+
from typing import NoReturn
362362

363363
def no_return() -> NoReturn: pass
364364
def f() -> NoReturn:
@@ -367,7 +367,7 @@ def f() -> NoReturn:
367367

368368
[case testNoReturnDisallowsImplicitReturn]
369369
# flags: --warn-no-return
370-
from mypy_extensions import NoReturn
370+
from typing import NoReturn
371371

372372
def f() -> NoReturn: # E: Implicit return in function which does not return
373373
non_trivial_function = 1
@@ -391,7 +391,7 @@ x = force_forward_reference()
391391

392392
[case testNoReturnNoWarnNoReturn]
393393
# flags: --warn-no-return
394-
from mypy_extensions import NoReturn
394+
from typing import NoReturn
395395

396396
def no_return() -> NoReturn: pass
397397
def f() -> int:
@@ -403,7 +403,7 @@ def f() -> int:
403403

404404
[case testNoReturnInExpr]
405405
# flags: --warn-no-return
406-
from mypy_extensions import NoReturn
406+
from typing import NoReturn
407407

408408
def no_return() -> NoReturn: pass
409409
def f() -> int:
@@ -413,14 +413,14 @@ reveal_type(f() or no_return()) # N: Revealed type is "builtins.int"
413413

414414
[case testNoReturnVariable]
415415
# flags: --warn-no-return
416-
from mypy_extensions import NoReturn
416+
from typing import NoReturn
417417

418418
x = 0 # type: NoReturn # E: Incompatible types in assignment (expression has type "int", variable has type "Never")
419419
[builtins fixtures/dict.pyi]
420420

421421
[case testNoReturnAsync]
422422
# flags: --warn-no-return
423-
from mypy_extensions import NoReturn
423+
from typing import NoReturn
424424

425425
async def f() -> NoReturn: ...
426426

0 commit comments

Comments
 (0)