Skip to content

Commit

Permalink
Updated xunit_output to correctly output steps executed in a backgr…
Browse files Browse the repository at this point in the history
…ound section in addition to scenarios.

Signed-off-by: Kevin Stone <kevinastone@gmail.com>
  • Loading branch information
kevinastone committed Mar 3, 2013
1 parent b3a3ab7 commit f179e7e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lettuce/plugins/xunit_output.py
Expand Up @@ -50,10 +50,12 @@ def time_step(step):

@after.each_step
def create_test_case_step(step):
if step.scenario.outlines:
parent = step.scenario or step.background
if getattr(parent, 'outlines', None):
return

classname = utf8_string(u"%s : %s" % (step.scenario.feature.name, step.scenario.name))

name = getattr(parent, 'name', 'Background') # Background sections are nameless
classname = utf8_string(u"%s : %s" % (parent.feature.name, name))
tc = doc.createElement("testcase")
tc.setAttribute("classname", classname)
tc.setAttribute("name", step.sentence.encode('utf-8'))
Expand Down

0 comments on commit f179e7e

Please sign in to comment.