Fix paramters for ParallelTestSuite and RemoteTestRunner. (#1072)

* Fix paramters for ParallelTestSuite and RemoteTestRunner.

A new parameter `buffer` is added. `suites` is renamed to `subsuites`.

ParallelTestSuite:
https://github.com/django/django/blob/2fac0a18081dcc77fc860c801e5d727dc90435b3/django/test/runner.py#L468-L475

RemoteTestRunner:
https://github.com/django/django/blob/2fac0a18081dcc77fc860c801e5d727dc90435b3/django/test/runner.py#L350

`buffer` was added in https://github.com/django/django/commit/f6713cda89d323565cfdc867c977c3363edcfc3c,
`suites` was renamed in https://github.com/django/django/commit/cb6c19749d342c3dc0f97d89ff6887b220cf45b8.
Both of these changes were made in 4.1rc1.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>

* Adjust types of attributes for runners.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
PIG208
2022-09-20 01:52:16 -04:00
committed by GitHub
parent 6f9afd3cc9
commit 3bc8278424
+12 -6
View File
@@ -65,8 +65,9 @@ class RemoteTestResult:
class RemoteTestRunner:
resultclass: Any = ...
failfast: Any = ...
def __init__(self, failfast: bool = ..., resultclass: Optional[Any] = ...) -> None: ...
failfast: bool = ...
buffer: bool = ...
def __init__(self, failfast: bool = ..., resultclass: Optional[Any] = ..., buffer: bool = ...) -> None: ...
def run(self, test: Any): ...
def default_test_processes() -> int: ...
@@ -75,10 +76,15 @@ class ParallelTestSuite(TestSuite):
init_worker: Any = ...
run_subsuite: Any = ...
runner_class: Any = ...
subsuites: Any = ...
processes: Any = ...
failfast: Any = ...
def __init__(self, suite: Any, processes: Any, failfast: bool = ...) -> None: ...
subsuites: List[TestSuite] = ...
processes: int = ...
failfast: bool = ...
buffer: bool = ...
initial_settings: Any = ...
serialized_contents: Any = ...
def __init__(
self, subsuites: List[TestSuite], processes: int, failfast: bool = ..., buffer: bool = ...
) -> None: ...
def run(self, result: Any): ... # type: ignore[override]
class DiscoverRunner: