Search code examples
pythondjangolettuce

How to skip a scenario in Lettuce?


I'm using Lettuce to do BDD testing on my Django website. I'm also using CircleCI do some continuous integration. I have a scenario that fails on CircleCI every time, so I'd like to tell CircleCI to skip it. Something like:

@skip_circle
Scenario: My Scenario blah blah
    Give I am skipping some scenarios
    .
    .
    .

Is this possible with Lettuce?


Solution

  • I was able to find out that this feature is already implemented, just not documented. And the decorators are actually called "Tags".

    @skip_circle
    Scenario: My scenario that does stuff
        Given I do stuff
        .
        .
    

    Then run:

    lettuce --tag=-skip_circle
    ./manage.py harvest --tag=-skip_circle #for django
    

    If you leave out the minus sign, you'll only run tests with that tag. The minus sign tells lettuce to skip the tag.