Skip to content

Instantly share code, notes, and snippets.

@jtatum
Created March 25, 2013 20:45

Revisions

  1. jtatum created this gist Mar 25, 2013.
    31 changes: 31 additions & 0 deletions gistfile1.feature
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    @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
    """