Parser correctly handles steps that are not left-aligned
(pytester)
| 668 | |
| 669 | |
| 670 | def test_right_aligned_steps(pytester): |
| 671 | """Parser correctly handles steps that are not left-aligned""" |
| 672 | pytester.makefile( |
| 673 | ".feature", |
| 674 | right_aligned_steps="""\ |
| 675 | Feature: Non-standard step indentation |
| 676 | Scenario: Indent my steps |
| 677 | Given I indent with 4 spaces |
| 678 | Then I indent with 5 spaces to line up |
| 679 | """, |
| 680 | ) |
| 681 | pytester.makepyfile( |
| 682 | textwrap.dedent( |
| 683 | """\ |
| 684 | from pytest_bdd import given, then, scenarios |
| 685 | |
| 686 | scenarios("right_aligned_steps.feature") |
| 687 | |
| 688 | @given("I indent with 4 spaces") |
| 689 | def _(): |
| 690 | pass |
| 691 | |
| 692 | @then("I indent with 5 spaces to line up") |
| 693 | def _(): |
| 694 | pass |
| 695 | |
| 696 | """ |
| 697 | ) |
| 698 | ) |
| 699 | result = pytester.runpytest() |
| 700 | result.assert_outcomes(passed=1, failed=0) |
| 701 | |
| 702 | |
| 703 | def test_keywords_used_outside_steps(pytester): |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…