From 18d05e4c5318c8f11fd79782ccbcee41594a4b1f Mon Sep 17 00:00:00 2001 From: DetachHead <57028336+DetachHead@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:42:26 +1000 Subject: [PATCH] fix types --- python_files/vscode_pytest/__init__.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/python_files/vscode_pytest/__init__.py b/python_files/vscode_pytest/__init__.py index d0148fa33754..6effff67845a 100644 --- a/python_files/vscode_pytest/__init__.py +++ b/python_files/vscode_pytest/__init__.py @@ -892,24 +892,13 @@ def send_post_request( ) -try: - import xdist # pyright: ignore[reportMissingImports] # noqa: F401 -except ModuleNotFoundError: - pass -else: - - @pytest.hookimpl(wrapper=True) - def pytest_xdist_auto_num_workers(config: pytest.Config) -> Generator[None, int, int]: - """determine how many workers to use based on how many tests were selected in the test explorer""" - return min((yield), len(config.option.file_or_dir)) - class DeferPlugin: @pytest.hookimpl(wrapper=True) def pytest_xdist_auto_num_workers(self, config: pytest.Config): """determine how many workers to use based on how many tests were selected in the test explorer""" return min((yield), len(config.option.file_or_dir)) -def pytest_plugin_registered(plugin, manager): +def pytest_plugin_registered(plugin: object, manager: pytest.PytestPluginManager): if manager.hasplugin("xdist") and not isinstance(plugin, DeferPlugin): manager.register(DeferPlugin())