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

Function test_multilanguage_support

tests/feature/test_scenario.py:316–395  ·  view source on GitHub ↗

Test multilanguage support.

(pytester)

Source from the content-addressed store, hash-verified

314
315
316def test_multilanguage_support(pytester):
317 """Test multilanguage support."""
318 pytester.makefile(
319 ".feature",
320 simple="""
321 # language: it
322
323 Funzionalità: Funzionalità semplice
324
325 Contesto:
326 Dato che uso uno step nel contesto
327 Allora va tutto bene
328
329 Scenario: Scenario semplice
330 Dato che uso uno step con "Dato"
331 E che uso uno step con "E"
332 Ma che uso uno step con "Ma"
333 * che uso uno step con "*"
334 Allora va tutto bene
335
336 Schema dello scenario: Scenario con schema
337 Dato che uso uno step con "<nome esempio>"
338 Allora va tutto bene
339
340 Esempi:
341 | nome esempio |
342 | esempio 1 |
343 | esempio 2 |
344 """,
345 )
346 pytester.makepyfile(
347 """
348 from pytest_bdd import scenario, given, then, parsers
349 from pytest_bdd.utils import dump_obj
350
351 @scenario("simple.feature", "Scenario semplice")
352 def test_scenario_semplice():
353 pass
354
355 @scenario("simple.feature", "Scenario con schema")
356 def test_scenario_con_schema():
357 pass
358
359 @given("che uso uno step nel contesto")
360 def _():
361 return dump_obj(("given", "che uso uno step nel contesto"))
362
363 @given(parsers.parse('che uso uno step con "{step_name}"'))
364 def _(step_name):
365 return dump_obj(("given", "che uso uno step con ", step_name))
366
367 @then("va tutto bene")
368 def _():
369 dump_obj(("then", "va tutto bene"))
370 """
371 )
372 result = pytester.runpytest("-s")
373 result.assert_outcomes(passed=3)

Callers

nothing calls this directly

Calls 1

collect_dumped_objectsFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…