Skip to content

Why doesn't pytest use decorators for tests discovery and/or hooks? #10783

Answered by nicoddemus
alexisml asked this question in General
Discussion options

You must be logged in to vote

Pytest does exactly what jUnit did way ago... why hasn't pytest adopted an explicit way of discovering tests (using a decorator)?

Mostly backward compatibility reasons. Using decorators is supported by https://github.com/pytest-dev/pluggy, and tox for example started adopting hooks using decorators directly, but for pytest we never discussed adopting decorators as there has no user demand, and adopting an alternative way of doing things is always extra work.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alexisml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants