From the course: Create an Open-Source Project in Python

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

Skipping a test, with good reasons

Skipping a test, with good reasons - Python Tutorial

From the course: Create an Open-Source Project in Python

Skipping a test, with good reasons

- [Instructor] Before we finish this chapter, the last useful tip to help writing and maintaining tests is to skip some tests. Yes, you heard it right. Some test are expected to fail under certain circumstances. So we must deal with them. For example, if certain features are not supported on a certain platform, they should not be tested against that platform. Sometimes feature in our application are not backwards-compatible, meaning that they will only work on newer versions of Python. The reverse can also happen when an old feature no longer works on the newer versions of Python. Another good reason to skip a test is that the feature is simply not implemented yet, or it is temporarily removed or unavailable. We do not want to test features that are not supposed to be working yet. So, now that we know why we will skip some tests, how do we do it? In pytest, it's very simple. You can skip the whole test by using…

Contents