From 8967976443f6eb13f037e031b015b1764006033c Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 14 Jan 2019 14:38:58 -0500 Subject: [PATCH] Ensure xml object is viable before testing family type --- src/_pytest/junitxml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py index 96755cf5b..e2e1d43bb 100644 --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -311,7 +311,7 @@ def record_xml_attribute(request): attr_func = add_attr_noop xml = getattr(request.config, "_xml", None) - if xml.family != "xunit1": + if xml is not None and xml.family != "xunit1": request.node.warn( PytestWarning( "record_xml_attribute is incompatible with junit_family: "