Skip to content

Instantly share code, notes, and snippets.

@jtatum
Created March 25, 2013 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtatum/5240548 to your computer and use it in GitHub Desktop.
Save jtatum/5240548 to your computer and use it in GitHub Desktop.
@issue
Feature: Issue #TBD: Logging starts with a StreamHandler way too early
Scenario:
Given a file named "features/steps/steps.py" with:
"""
import logging
from behave import given, when, then, step
@step('I log debug {num} times')
def log_output(context, num):
for i in xrange(int(num)):
logging.debug('Some debug logging')
"""
And a file named "features/issueTBD_example.feature" with:
"""
Feature: Logging should not be output unless there is a failure
Scenario: A passing test
Given I log debug 5 times
"""
When I run "behave -f plain features/issueTBD_example.feature"
Then it should pass
And the command output should not contain:
"""
DEBUG:root:Some debug logging
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment