Skip to content

Commit 51cd4a0

Browse files
committed
Revert "End session on session fixture failure"
This reverts commit 39646d2.
1 parent 363e7dd commit 51cd4a0

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/pytest_netdut/factories.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import pytest
2020
from packaging import version
2121
from .wrappers import CLI, xapi
22-
import traceback
2322

2423
logger = logging.getLogger(__name__)
2524

@@ -297,10 +296,9 @@ def create_ssh_fixture(name):
297296
def _ssh(request):
298297
try:
299298
ssh = _CLI_wrapper(f"ssh://{request.getfixturevalue(f'{name}_hostname')}")
300-
except Exception:
299+
except Exception as exc:
301300
logging.error("Failed to create ssh fixture and log in")
302-
traceback.print_exc()
303-
pytest.exit("SSH fixture failure; terminating session")
301+
raise exc
304302
if ssh.cli_flavor == "mos":
305303
ssh.sendcmd("enable")
306304
yield ssh
@@ -316,10 +314,9 @@ def _console(request):
316314
# Ignore encoding errors for the console -- various conditions
317315
# cause non-UTF-8 characters to be received.
318316
console = _CLI_wrapper(console_url, ignore_encoding_errors=True)
319-
except Exception:
317+
except Exception as exc:
320318
logging.error("Failed to create console fixture and log in")
321-
traceback.print_exc()
322-
pytest.exit("Console fixture failure; terminating session")
319+
raise exc
323320
if console.cli_flavor == "mos":
324321
console.sendcmd("enable")
325322
yield console

0 commit comments

Comments
 (0)