bfan
bfan

Reputation: 65

Executing specific tests using pytest

Is there a way in pytest to add an attribute to a test, say for example "smoke test" or "regression" and then run only those tests?

Upvotes: 3

Views: 6679

Answers (1)

Laurent Bristiel
Laurent Bristiel

Reputation: 6935

Yes, you can use Markers for that.

See "Marking test functions and selecting them for a run"

Essentially, you will "mark" some of your tests with @pytest.mark.smoke and then launch them with a command like $ pytest -m smoke.

Upvotes: 11

Related Questions