Feature: Addition tests
@one
Scenario: Add two numbers to pass
Given two numbers to add
When 2 and 3 are added together
Then the sum should be 5
@two
Scenario: Add two numbers to fail
Given two numbers to add
When 2 and 3 are added together
Then the sum should be 6
실행 중 >> behave --tags = "@ one"(또는 behave --tags = one)
@one
Scenario: Add two numbers to pass # features/Add.feature:4
Given two numbers to add # features/steps/Maths.py:4 0.000s
When 2 and 3 are added together # features/steps/Maths.py:8 0.000s
Then the sum should be 5 # features/steps/Maths.py:12 0.000s
@two
Scenario: Add two numbers to fail # features/Add.feature:10
Given two numbers to add # None
When 2 and 3 are added together # None
Then the sum should be 6 # None
예상대로.
아직 실행 중 >> behave --tags = "@ one 또는 @two"
@one
Scenario: Add two numbers to pass # features/Add.feature:4
Given two numbers to add # None
When 2 and 3 are added together # None
Then the sum should be 5 # None
@two
Scenario: Add two numbers to fail # features/Add.feature:10
Given two numbers to add # None
When 2 and 3 are added together # None
Then the sum should be 6 # None
이것은 두 시나리오를 모두 실행해야하며 모든 튜토리얼에 따라 여러 시나리오를 실행하는 방법 인 것 같습니다. 여기서 분명한 것이 누락 되었습니까 (그리고 확실히 "or"를 실행하고 --tags = "@ one 및 @two"로 동작하지 않음)?
이 기능은 최신 버전 문서에 설명되어 있지만 안정 버전 에서는 사용할 수 없습니다 .이 답변을 작성하는 시점은 1.2.6입니다. 귀하의 문제는 얼마 전에 github 에 문서화 되었으며 닫혔습니다 .
버전 1.2.6 이하가 설치되었을 가능성이 있습니다.이 경우 논리적 OR에 다음 중 하나를 사용해야합니다.
behave --tags=one,two
#that's the same thing as
behave --tags @one,@two
behave --tags-help
유용한 정보도 제공합니다.
업그레이드하려면 현재 behave
버전을 제거하고 사용 가능한 최신 태그 릴리스 (현재 v1.2.7.v1)를 설치하십시오.
sudo pip uninstall behave
pip install git+https://github.com/behave/[email protected]
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다