From c91e51459ffc277359bf9d0521531ddc6f7b717d Mon Sep 17 00:00:00 2001 From: Anton Danchenko Date: Thu, 29 Nov 2018 20:16:26 +0200 Subject: [PATCH] fix pytest internal error if no response from saucelabs Signed-off-by: Anton Danchenko --- test/appium/tests/conftest.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/appium/tests/conftest.py b/test/appium/tests/conftest.py index dc5761f863..a1719dfb5e 100644 --- a/test/appium/tests/conftest.py +++ b/test/appium/tests/conftest.py @@ -2,7 +2,7 @@ import requests import pytest import re from _pytest.runner import runtestprotocol - +from http.client import RemoteDisconnected from support.device_stats_db import DeviceStatsDB from support.test_rerun import should_rerun_test from tests import test_suite_data, appium_container @@ -236,7 +236,10 @@ def pytest_runtest_makereport(item, call): def update_sauce_jobs(test_name, job_ids, passed): for job_id in job_ids.keys(): - sauce.jobs.update_job(job_id, name=test_name, passed=passed) + try: + sauce.jobs.update_job(job_id, name=test_name, passed=passed) + except RemoteDisconnected: + pass def get_testrail_case_id(obj):