Hi all, I'm looking to introduce BDD to our monore...
# general
b
Hi all, I'm looking to introduce BDD to our monorepo, and wonder how much work it will be to use
behave
for testing BDDs. I would just need to invoke
behave
instead of
pytest
and maybe tweak some args here and there.
c
@powerful-umbrella-75231 has a use case of this he might be willing to share a bit of.. 😉 ?
h
Hi! I don’t know much about behave. Is it more-or-less a drop-in replacement for pytest?
c
No, it’s a different way of running tests, where you have Gherkin (cucumber) test descriptions along with test implementations for the steps. https://cucumber.io/
behave is a Python implementation for ^^
I’ve been contemplating implementing first class support for behave in pants.
(at the time we were implementing the thing I was asking if @powerful-umbrella-75231 could share a bit of..)
b
There is also
pytest-bdd
and it works ok-ish for most cases, but their cucumber implementation is a custom one, not the official library, and there are rough edges when it comes to dealing with e.g. multi-line test cases and embedded data tables
h
I think likely the cleanest approach is to create a new target type like
python_behave_test
and
python_behave_tests
. That way there's no ambiguity with pants trying to run its Pytest implementation on those files