So I am trying to implement an @warn
tag. The idea is this test doesn't make an assertion and fail, but instead simply prints out a warning. I see this answer here, but that only explains how to do it on command line or in Behave.ini file, but I don't want to turn it on for all tests, just ones tagged warn. I tried this in my environment file but with no success:
def before_scenario(context, scenario):
if 'warn' in context.tags:
# Set to immediately out rather than keep for fail
stdout_capture = False
stderr_capture = False
def after_scenario(context, scenario):
if 'warn' in context.tags:
stdout_capture = True
stderr_capture = True