Skip to content

Commit 8967976

Browse files
committed
Ensure xml object is viable before testing family type
1 parent bcacc40 commit 8967976

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/_pytest/junitxml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def add_attr_noop(name, value):
311311
attr_func = add_attr_noop
312312
xml = getattr(request.config, "_xml", None)
313313

314-
if xml.family != "xunit1":
314+
if xml is not None and xml.family != "xunit1":
315315
request.node.warn(
316316
PytestWarning(
317317
"record_xml_attribute is incompatible with junit_family: "

0 commit comments

Comments
 (0)