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

Method render_datatable

src/pytest_bdd/parser.py:325–341  ·  view source on GitHub ↗

Render the datatable with the given context, but avoid replacing text inside angle brackets if context is missing. Args: datatable (DataTable): The datatable to render. context (Mapping[str, Any]): The context for rendering the datatable. Re

(datatable: DataTable, context: Mapping[str, object])

Source from the content-addressed store, hash-verified

323
324 @staticmethod
325 def render_datatable(datatable: DataTable, context: Mapping[str, object]) -> DataTable:
326 """
327 Render the datatable with the given context,
328 but avoid replacing text inside angle brackets if context is missing.
329
330 Args:
331 datatable (DataTable): The datatable to render.
332 context (Mapping[str, Any]): The context for rendering the datatable.
333
334 Returns:
335 datatable (DataTable): The rendered datatable with parameters replaced only if they exist in the context.
336 """
337 rendered_datatable = copy.deepcopy(datatable)
338 for row in rendered_datatable.rows:
339 for cell in row.cells:
340 cell.value = render_string(cell.value, context)
341 return rendered_datatable
342
343
344@dataclass(eq=False)

Callers 1

renderMethod · 0.80

Calls 1

render_stringFunction · 0.85

Tested by

no test coverage detected