Добрый день.
Кто может помочь настроить запуск тестов из PyCharm 2020.3.1 с помощью pytest на macOS 11.1 (Big Sur)?
Python 3.8.2
pytest==6.2.1
selenium==3.141.0
ChromeDriver лежит в "/usr/local/bin/chromedriver"
Есть
conftest.py{
@pytest.fixture(scope="session")
def driver(request):
chrome_options = Options()
chrome_options.add_argument("--disable-infobars")
chrome_options.add_argument("--disable-extensions")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-gpu")
wd = webdriver.Chrome(options=chrome_options, service_log_path="./logs")
request.addfinalizer(wd.quit())
return wd}
При запуске тест валится:
{E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='
127.0.0.1', port=55489): Max retries exceeded with url: /session/b9f15ce3c50986c0d82d68e4cb4d16bb/url (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x110edf1c0>: Failed to establish a new connection: [Errno 61] Connection refused'))
../../../../Library/Python/3.8/lib/python/site-packages/urllib3/util/retry.py:573: MaxRetryError}
{-------------------------------- live log call ---------------------------------
12:40:04 [WARNING] Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x1109273d0>: Failed to establish a new connection: [Errno 61] Connection refused')': /session/b9f15ce3c50986c0d82d68e4cb4d16bb/url
12:40:04 [WARNING] Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x11113ab80>: Failed to establish a new connection: [Errno 61] Connection refused')': /session/b9f15ce3c50986c0d82d68e4cb4d16bb/url
12:40:04 [WARNING] Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x110ed0e80>: Failed to establish a new connection: [Errno 61] Connection refused')': /session/b9f15ce3c50986c0d82d68e4cb4d16bb/url
FAILED [100%]
}
Но если убрать строку {request.addfinalizer(wd.quit())}, то тест проходит нормально.