mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Fix unittest for 3.13 (#12307)
This commit is contained in:
@@ -5,7 +5,7 @@ from collections.abc import Callable, Sequence
|
||||
from re import Pattern
|
||||
from types import ModuleType
|
||||
from typing import Any
|
||||
from typing_extensions import TypeAlias
|
||||
from typing_extensions import TypeAlias, deprecated
|
||||
|
||||
_SortComparisonMethod: TypeAlias = Callable[[str, str], int]
|
||||
_SuiteClass: TypeAlias = Callable[[list[unittest.case.TestCase]], unittest.suite.TestSuite]
|
||||
@@ -34,18 +34,22 @@ class TestLoader:
|
||||
|
||||
defaultTestLoader: TestLoader
|
||||
|
||||
def getTestCaseNames(
|
||||
testCaseClass: type[unittest.case.TestCase],
|
||||
prefix: str,
|
||||
sortUsing: _SortComparisonMethod = ...,
|
||||
testNamePatterns: list[str] | None = None,
|
||||
) -> Sequence[str]: ...
|
||||
def makeSuite(
|
||||
testCaseClass: type[unittest.case.TestCase],
|
||||
prefix: str = "test",
|
||||
sortUsing: _SortComparisonMethod = ...,
|
||||
suiteClass: _SuiteClass = ...,
|
||||
) -> unittest.suite.TestSuite: ...
|
||||
def findTestCases(
|
||||
module: ModuleType, prefix: str = "test", sortUsing: _SortComparisonMethod = ..., suiteClass: _SuiteClass = ...
|
||||
) -> unittest.suite.TestSuite: ...
|
||||
if sys.version_info < (3, 13):
|
||||
@deprecated("Deprecated in Python 3.11; removal scheduled for Python 3.13")
|
||||
def getTestCaseNames(
|
||||
testCaseClass: type[unittest.case.TestCase],
|
||||
prefix: str,
|
||||
sortUsing: _SortComparisonMethod = ...,
|
||||
testNamePatterns: list[str] | None = None,
|
||||
) -> Sequence[str]: ...
|
||||
@deprecated("Deprecated in Python 3.11; removal scheduled for Python 3.13")
|
||||
def makeSuite(
|
||||
testCaseClass: type[unittest.case.TestCase],
|
||||
prefix: str = "test",
|
||||
sortUsing: _SortComparisonMethod = ...,
|
||||
suiteClass: _SuiteClass = ...,
|
||||
) -> unittest.suite.TestSuite: ...
|
||||
@deprecated("Deprecated in Python 3.11; removal scheduled for Python 3.13")
|
||||
def findTestCases(
|
||||
module: ModuleType, prefix: str = "test", sortUsing: _SortComparisonMethod = ..., suiteClass: _SuiteClass = ...
|
||||
) -> unittest.suite.TestSuite: ...
|
||||
|
||||
Reference in New Issue
Block a user