Getting started with pytest Transcripts
Chapter: Markers
Lecture: Introducing markers
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
Welcome to Chapter five markers, markers come in a couple of different flavors.
0:06
We have custom markers. These can be used like tags or labels for tests. They can be used to help run a subset of tests or avoid running a subset
0:17
and then there's built in markers built in markers are things like pytest mark parameterize which we've seen and they can change the behavior of tests.
0:26
The built in markers, there's a bunch of them, but the most commonly used built in markers are parametrize, skip, skip if and X fail.
0:36
Custom markers are used just like a normal built in markers, but you just make up the name in this case,
0:43
Mark smoke. They need to be declared in a pytest any file or some other config file and they can be used on multiple tests and then you can use
0:53
the -M flag to run only the tests you've marked or you can combine it like not smoke or smoke and not something else.