fix pytest internal error if no response from saucelabs

Signed-off-by: Anton Danchenko <ant.danchenko@gmail.com>
This commit is contained in:
Anton Danchenko 2018-11-29 20:16:26 +02:00
parent bb4264ac70
commit c91e51459f
No known key found for this signature in database
GPG Key ID: C2D4819B698627E4
1 changed files with 5 additions and 2 deletions

View File

@ -2,7 +2,7 @@ import requests
import pytest import pytest
import re import re
from _pytest.runner import runtestprotocol from _pytest.runner import runtestprotocol
from http.client import RemoteDisconnected
from support.device_stats_db import DeviceStatsDB from support.device_stats_db import DeviceStatsDB
from support.test_rerun import should_rerun_test from support.test_rerun import should_rerun_test
from tests import test_suite_data, appium_container 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): def update_sauce_jobs(test_name, job_ids, passed):
for job_id in job_ids.keys(): for job_id in job_ids.keys():
try:
sauce.jobs.update_job(job_id, name=test_name, passed=passed) sauce.jobs.update_job(job_id, name=test_name, passed=passed)
except RemoteDisconnected:
pass
def get_testrail_case_id(obj): def get_testrail_case_id(obj):