mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-37841: Use official hook API to parse config instead of dirty hack.
See Bruno's comment in issue. GitOrigin-RevId: af0c4bee1f415a2148e7a824630a949ba3db0051
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ef0b36a968
commit
29ca363a7c
@@ -3,7 +3,6 @@ import sys
|
||||
|
||||
import pytest
|
||||
from _pytest.config import get_plugin_manager
|
||||
from _pytest import config
|
||||
|
||||
from pkg_resources import iter_entry_points
|
||||
|
||||
@@ -31,11 +30,13 @@ if __name__ == '__main__':
|
||||
args += ["-s"]
|
||||
|
||||
jb_doc_args("pytest", args)
|
||||
# We need to preparse numprocesses because user may set it using ini file
|
||||
config_result = config._prepareconfig(args, plugins_to_load)
|
||||
|
||||
if getattr(config_result.option, "numprocesses", None):
|
||||
set_parallel_mode()
|
||||
class Plugin:
|
||||
@staticmethod
|
||||
def pytest_configure(config):
|
||||
if getattr(config.option, "numprocesses", None):
|
||||
set_parallel_mode()
|
||||
start_protocol()
|
||||
|
||||
start_protocol()
|
||||
pytest.main(args, plugins_to_load)
|
||||
|
||||
pytest.main(args, plugins_to_load + [Plugin])
|
||||
|
||||
Reference in New Issue
Block a user