pytest-bdd icon indicating copy to clipboard operation
pytest-bdd copied to clipboard

Setting a default parser

Open theObserver1 opened this issue 3 years ago • 3 comments
trafficstars

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

theObserver1 avatar Dec 18 '21 14:12 theObserver1

Already discussed in #425

elchupanebrej avatar Jan 01 '22 20:01 elchupanebrej

#472 address this

elchupanebrej avatar Jan 03 '22 21:01 elchupanebrej

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!

youtux avatar Feb 24 '22 12:02 youtux