M test/harness/harness.py => test/harness/harness.py +5 -1
@@ 72,7 72,11 @@ class Harness:
def send_text(self, text: str):
for letter in text:
- send_char(letter, self.connection)
+ try:
+ send_char(letter, self.connection)
+ except KeyError as e:
+ available = ' '.join((f"'{_}'" for _ in utils.keymap.keys()))
+ raise LookupError(f"Character {e} not present in the keymap\nAvailable characters: {available}")
def send_number(self, number: str):
utils.send_number(number, self.connection)
M test/harness/utils.py => test/harness/utils.py +2 -1
@@ 156,7 156,8 @@ class Timeout(Exception):
@classmethod
@contextmanager
- def limit(cls, seconds):
+ def limit(cls, seconds: int):
+ assert seconds >= 1, "Timeout must be at least 1 second !"
def signal_handler(signum, frame):
raise Timeout("Timed out!")
M test/pytest/conftest.py => test/pytest/conftest.py +1 -1
@@ 54,7 54,7 @@ def harness(request):
Try to init one Pure phone with serial port path or automatically
'''
port_name = request.config.option.port
- TIMEOUT = int(request.config.option.timeout)
+ TIMEOUT = min(1, request.config.option.timeout)
timeout_started = time.time()
RETRY_EVERY_SECONDS = 1.0