Skip to content

Commit 1e68628

Browse files
authored
fix funcargs (#160)
1 parent af92c35 commit 1e68628

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

conftest.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,17 @@ def pytest_exception_interact(node, call, report):
7070
test_name = node.name
7171
test_name = sanitize_filename(test_name)
7272
logging.error(f"Handling exception for test: {test_name}")
73-
logging.error(
74-
f"NODE LOGS HERE {node.funcargs}\n THE FAILED TEST: {test_name}"
75-
)
76-
driver = node.funcargs.get("driver")
77-
opt_ci = node.funcargs.get("opt_ci")
78-
if driver:
79-
log_content(opt_ci, driver, test_name)
80-
screenshot_content(driver, opt_ci, test_name)
73+
if hasattr(node, "funcargs"):
74+
logging.error(
75+
f"NODE LOGS HERE {node.funcargs}\n THE FAILED TEST: {test_name}"
76+
)
77+
driver = node.funcargs.get("driver")
78+
opt_ci = node.funcargs.get("opt_ci")
79+
if driver:
80+
log_content(opt_ci, driver, test_name)
81+
screenshot_content(driver, opt_ci, test_name)
82+
else:
83+
logging.error("Error occurred during collection.")
8184
except Exception as e:
8285
logging.warning("Something went wrong with the exception catching.")
8386
raise e

0 commit comments

Comments
 (0)