# Path: pytest_bdd/scenario.py
# def get_python_name_generator(name: str) -> Iterable[str]:
#     """Generate a sequence of suitable python names out of given arbitrary string name."""
#     python_name = make_python_name(name)
#     suffix = ""
#     index = 0
# 
#     def get_name() -> str:
#         return f"test_{python_name}{suffix}"
# 
#     while True:
#         yield get_name()
#         index += 1
#         suffix = f"_{index}"
# 
# Path: tests/utils.py
# def assert_outcomes(
#     result: RunResult,
#     passed: int = 0,
#     skipped: int = 0,
#     failed: int = 0,
#     errors: int = 0,
#     xpassed: int = 0,
#     xfailed: int = 0,
# ) -> None:
#     """Compatibility function for result.assert_outcomes"""
#     result.assert_outcomes(
#         errors=errors, passed=passed, skipped=skipped, failed=failed, xpassed=xpassed, xfailed=xfailed
#     )


import itertools
import textwrap
from pytest_bdd.scenario import get_python_name_generator
from tests.utils import assert_outcomes
                    Given I have a custom bar
            """
        ),
    )

    testdir.makepyfile(
        textwrap.dedent(
            """\
        import functools

        from pytest_bdd import scenario, given

        scenario = functools.partial(scenario, "generation.feature")

        @given("I have a bar")
        def i_have_a_bar():
            return "bar"

        @scenario("Scenario tests which are already bound to the tests stay as is")
        def test_foo():
            pass

        @scenario("Code is generated for scenario steps which are not yet defined(implemented)")
        def test_missing_steps():
            pass
        """
        )
    )

    result = testdir.runpytest("--generate-missing", "--feature", "generation.feature")

# Path: pytest_bdd/scenario.py
# def get_python_name_generator(name: str) -> Iterable[str]:
#     """Generate a sequence of suitable python names out of given arbitrary string name."""
#     python_name = make_python_name(name)
#     suffix = ""
#     index = 0
# 
#     def get_name() -> str:
#         return f"test_{python_name}{suffix}"
# 
#     while True:
#         yield get_name()
#         index += 1
#         suffix = f"_{index}"
# 
# Path: tests/utils.py
# def assert_outcomes(
#     result: RunResult,
#     passed: int = 0,
#     skipped: int = 0,
#     failed: int = 0,
#     errors: int = 0,
#     xpassed: int = 0,
#     xfailed: int = 0,
# ) -> None:
#     """Compatibility function for result.assert_outcomes"""
#     result.assert_outcomes(
#         errors=errors, passed=passed, skipped=skipped, failed=failed, xpassed=xpassed, xfailed=xfailed
#     )


# Path: tests/generation/test_generate_missing.py
import itertools
import textwrap
from pytest_bdd.scenario import get_python_name_generator
from tests.utils import assert_outcomes

                    Given I have a custom bar
            """
        ),
    )

    testdir.makepyfile(
        textwrap.dedent(
            """\
        import functools

        from pytest_bdd import scenario, given

        scenario = functools.partial(scenario, "generation.feature")

        @given("I have a bar")
        def i_have_a_bar():
            return "bar"

        @scenario("Scenario tests which are already bound to the tests stay as is")
        def test_foo():
            pass

        @scenario("Code is generated for scenario steps which are not yet defined(implemented)")
        def test_missing_steps():
            pass
        """
        )
    )

    result = testdir.runpytest("--generate-missing", "--feature", "generation.feature")

    assert_outcomes(result, passed=0, failed=0, errors=0)