File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1919import pytest
2020from packaging import version
2121from .wrappers import CLI , xapi
22+ import traceback
2223
2324logger = logging .getLogger (__name__ )
2425
@@ -296,9 +297,10 @@ def create_ssh_fixture(name):
296297 def _ssh (request ):
297298 try :
298299 ssh = _CLI_wrapper (f"ssh://{ request .getfixturevalue (f'{ name } _hostname' )} " )
299- except Exception as exc :
300+ except Exception :
300301 logging .error ("Failed to create ssh fixture and log in" )
301- raise exc
302+ traceback .print_exc ()
303+ pytest .exit ("SSH fixture failure; terminating session" )
302304 if ssh .cli_flavor == "mos" :
303305 ssh .sendcmd ("enable" )
304306 yield ssh
@@ -314,9 +316,10 @@ def _console(request):
314316 # Ignore encoding errors for the console -- various conditions
315317 # cause non-UTF-8 characters to be received.
316318 console = _CLI_wrapper (console_url , ignore_encoding_errors = True )
317- except Exception as exc :
319+ except Exception :
318320 logging .error ("Failed to create console fixture and log in" )
319- raise exc
321+ traceback .print_exc ()
322+ pytest .exit ("Console fixture failure; terminating session" )
320323 if console .cli_flavor == "mos" :
321324 console .sendcmd ("enable" )
322325 yield console
You can’t perform that action at this time.
0 commit comments