MCPcopy Create free account
hub / github.com/pytest-dev/pytest-bdd / get_python_name_generator

Function get_python_name_generator

src/pytest_bdd/scenario.py:423–435  ·  view source on GitHub ↗

Generate a sequence of suitable python names out of given arbitrary string name.

(name: str)

Source from the content-addressed store, hash-verified

421
422
423def get_python_name_generator(name: str) -> Iterable[str]:
424 """Generate a sequence of suitable python names out of given arbitrary string name."""
425 python_name = make_python_name(name)
426 suffix = ""
427 index = 0
428
429 def get_name() -> str:
430 return f"test_{python_name}{suffix}"
431
432 while True:
433 yield get_name()
434 index += 1
435 suffix = f"_{index}"
436
437
438def scenarios(*feature_paths: str, **kwargs: Any) -> None:

Callers 2

scenariosFunction · 0.85

Calls 2

make_python_nameFunction · 0.85
get_nameFunction · 0.85

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…