Skip to content

Instantly share code, notes, and snippets.

@erik-smit
Created August 8, 2020 11:43
Show Gist options
  • Save erik-smit/c36c87b45c23948da7fd1697e7344020 to your computer and use it in GitHub Desktop.
Save erik-smit/c36c87b45c23948da7fd1697e7344020 to your computer and use it in GitHub Desktop.
=============================================================================== short test summary info ================================================================================
FAILED unit_tests/test_scenario_outline.py::test_a_flat_scenario[foo] - AssertionError: assert '<varname>' == 'foo'
FAILED unit_tests/test_scenario_outline.py::test_a_flat_scenario[bar] - AssertionError: assert '<varname>' == 'foo'
FAILED unit_tests/test_scenario_outline.py::test_a_flat_scenario[baz] - AssertionError: assert '<varname>' == 'foo'
Feature: Scenario Outlines
Scenario Outline: A flat scenario
Given Some scenario with variable <varname>
Then It should be the right thing
Examples:
| varname |
| foo |
| bar |
| baz |
import struct
from pytest_bdd import given, parsers, scenarios, then, when
scenarios("test_scenario_outline.feature")
@given(parsers.parse("Some scenario with variable {varname}"))
def some_scenario(context, varname):
context.block = varname
@then("It should be the right thing")
def it_should_be_the_right_thing(context):
assert context.block == "foo"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment