In this chapter, we learned how to use marks to organize our code and help us run the test suite in flexible ways. We then looked at how to use the @pytest.mark.skipif to conditionally skip tests, and how to use the @pytest.mark.xfail mark to deal with expected failures and flaky tests. Then we discussed ways of dealing with flaky tests in a collaborative environment. Finally, we discussed the benefits of using @pytest.mark.parametrize to avoid repeating our testing code and to make it easy for ourselves and others to add new input cases to existing tests.
In the next chapter, we will finally get to one of pytest's most loved and powerful features: fixtures.