Skip to content

Commit 6e2f3bf

Browse files
committed
More explicit messages if UiAutomatorHelper instrumentation is not found
1 parent 059fc4d commit 6e2f3bf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/com/dtmilano/android/uiautomator/uiautomatorhelper.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
@author: Diego Torres Milano
1919
'''
2020

21-
__version__ = '11.5.12'
21+
__version__ = '11.5.13'
2222

2323
import os
2424
import subprocess
@@ -105,8 +105,10 @@ def __init__(self, adbclient, adb=None, localport=9999, remoteport=9999, hostnam
105105
self.adbClient = adbclient
106106
''' The adb client (a.k.a. device) '''
107107
instrumentation = self.adbClient.shell('pm list instrumentation %s' % self.PACKAGE)
108-
if not re.match('instrumentation:%s/%s \(target=%s\)' % (self.TEST_CLASS, self.TEST_RUNNER, self.PACKAGE), instrumentation):
108+
if not instrumentation:
109109
raise RuntimeError('The target device does not contain the instrumentation for %s' % self.PACKAGE)
110+
if not re.match('instrumentation:%s/%s \(target=%s\)' % (self.TEST_CLASS, self.TEST_RUNNER, self.PACKAGE), instrumentation):
111+
raise RuntimeError('The instrumentation found for %s does not match the expected %s/%s' % (self.PACKAGE, self.TEST_CLASS, self.TEST_RUNNER))
110112
self.adb = self.__whichAdb(adb)
111113
''' The adb command '''
112114
self.osName = platform.system()

0 commit comments

Comments
 (0)