pytest-dev / pytest-bdd

BDD library for the pytest runner
https://pytest-bdd.readthedocs.io/en/latest/
MIT License
1.31k stars 220 forks source link

Setting a default parser #467

Open theObserver1 opened 2 years ago

theObserver1 commented 2 years ago

Is it currently possible to set a default parser? ie Instead of writing: @given(parsers.parse("the animal is {name}")

I want to configure parser.parse as the default (perhaps in pytest.ini) so i can then write: @given("the animal is {name}")

Reason: Clearer decorators

elchupanebrej commented 2 years ago

Already discussed in #425

elchupanebrej commented 2 years ago

472 address this

youtux commented 2 years ago

Hi, currently it's not possible. We could have a config option that defines the default parser in case a bare string is passed to @given(...). Feel free to contribute!