From 3bc8278424215dc59a04275a31174d9ccfc7b404 Mon Sep 17 00:00:00 2001 From: PIG208 <39874143+PIG208@users.noreply.github.com> Date: Tue, 20 Sep 2022 01:52:16 -0400 Subject: [PATCH] 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 * Adjust types of attributes for runners. Signed-off-by: Zixuan James Li Signed-off-by: Zixuan James Li --- django-stubs/test/runner.pyi | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/django-stubs/test/runner.pyi b/django-stubs/test/runner.pyi index 694afea..718601b 100644 --- a/django-stubs/test/runner.pyi +++ b/django-stubs/test/runner.pyi @@ -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: