Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
2.41.3
* Isolate Pillow import, with fallback if import fails
2.41.2
* Add api to abort a test run
2.41.1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys, os


version = '2.41.2'
version = '2.41.3'

setup(name='testdroid',
version=version,
Expand Down
9 changes: 7 additions & 2 deletions testdroid/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-

import os, sys, requests, json, logging, time, httplib, base64
from PIL import Image
from optparse import OptionParser
from datetime import datetime

__version__ = '2.41.2'
__version__ = '2.41.3'

FORMAT = "%(message)s"
logging.basicConfig(format=FORMAT)
Expand Down Expand Up @@ -633,9 +632,15 @@ def download_test_screenshots(self, project_id, test_run_id):
''' Earlier downloaded images are checked, and if needed re-downloaded.
'''
try:
from PIL import Image
im=Image.open(full_path)
im.verify()
logger.info("Screenshot %s already exists - skipping download" % full_path)
except ImportError:
if os.path.isfile(full_path): # fallback if Pillow fails to import
logger.info("Screenshot %s already exists - skipping download" % full_path)
else:
raise # jump to next block
except:
url = "me/projects/%s/runs/%s/device-runs/%s/screenshots/%s" % (project_id, test_run['id'], device_run['id'], screenshot['id'])
prog = DownloadProgressBar()
Expand Down