@@ -213,13 +213,13 @@ def render(self, context: Mapping[str, Any]) -> Scenario:
213
213
base_steps = self .all_background_steps + self ._steps
214
214
scenario_steps = [
215
215
Step (
216
- name = step .render_step_name ( context ),
216
+ name = render_string ( step .name , context ),
217
217
type = step .type ,
218
218
indent = step .indent ,
219
219
line_number = step .line_number ,
220
220
keyword = step .keyword ,
221
221
datatable = step .render_datatable (context ),
222
- docstring = step .render_docstring ( context ),
222
+ docstring = render_string ( step .docstring , context ) if step . docstring else None ,
223
223
)
224
224
for step in base_steps
225
225
]
@@ -329,19 +329,6 @@ def params(self) -> tuple[str, ...]:
329
329
"""
330
330
return tuple (frozenset (STEP_PARAM_RE .findall (self .name )))
331
331
332
- def render_step_name (self , context : Mapping [str , Any ]) -> str :
333
- """
334
- Render the step name with the given context,
335
- but avoid replacing text inside angle brackets if context is missing.
336
-
337
- Args:
338
- context (Mapping[str, Any]): The context for rendering the step name.
339
-
340
- Returns:
341
- str: The rendered step name with parameters replaced only if they exist in the context.
342
- """
343
- return render_string (self .name , context )
344
-
345
332
def render_datatable (self , context : Mapping [str , Any ]) -> DataTable | None :
346
333
"""
347
334
Render the datatable with the given context,
@@ -361,19 +348,6 @@ def render_datatable(self, context: Mapping[str, Any]) -> DataTable | None:
361
348
return rendered_datatable
362
349
return None
363
350
364
- def render_docstring (self , context : Mapping [str , Any ]) -> str | None :
365
- """
366
- Render the docstring with the given context,
367
- but avoid replacing text inside angle brackets if context is missing.
368
-
369
- Args:
370
- context (Mapping[str, Any]): The context for rendering the docstring.
371
-
372
- Returns:
373
- str: The rendered docstring with parameters replaced only if they exist in the context.
374
- """
375
- return render_string (self .docstring , context ) if self .docstring else None
376
-
377
351
378
352
@dataclass (eq = False )
379
353
class Background :
0 commit comments