From ab7634a3f9479aa3cb08a882545a6f439ea19874 Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Wed, 22 Feb 2017 16:31:31 +0300 Subject: [PATCH] PY-22750: Use better py.test API to prevent "Module already imported" warning --- python/helpers/pycharm/_jb_pytest_runner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/helpers/pycharm/_jb_pytest_runner.py b/python/helpers/pycharm/_jb_pytest_runner.py index 0f8d837817f6..18ca4cd3030b 100644 --- a/python/helpers/pycharm/_jb_pytest_runner.py +++ b/python/helpers/pycharm/_jb_pytest_runner.py @@ -3,7 +3,7 @@ import re import sys import pytest -from _pytest.config import _prepareconfig +from _pytest.config import get_plugin_manager from _jb_runner_tools import jb_start_tests, jb_patch_separator, jb_doc_args from teamcity import pytest_plugin @@ -22,6 +22,6 @@ if __name__ == '__main__': # plugin is discovered automatically in 3, but not in 2 # to prevent "plugin already registered" problem we check it first plugins_to_load = [] - if not _prepareconfig().pluginmanager.hasplugin("pytest-teamcity"): + if not get_plugin_manager().hasplugin("pytest-teamcity"): plugins_to_load.append(pytest_plugin) pytest.main(sys.argv[1:], plugins_to_load)