Search code examples
pythonbddpytestpython-behave

How to integrate behave into pytest?


I create a Django app and heavily rely on pytest to discover and organize my unit and functional tests. However, I want to apply Behaviour Driven with behave Development for future tests. Unfortunately, the behave test features are not auto-detected by pytest.

How can I integrate behave and its' tests into pytest discovery, execution and reporting?


Solution

  • Pytest and behave are two separate test runners.

    There is a pytest plugin for behavior testing which also uses Gherkin as a DSL but the implementation of the steps uses a syntax different from that of behave, so I don't think you can directly run the steps you created with it.