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 - 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
-
-
-
-
What is pytest?1m 57s
-
(Locked)
Introduction to your project2m 35s
-
(Locked)
Writing simple tests3m 51s
-
(Locked)
Testing with multiple parameters4m 17s
-
(Locked)
Test if an exception is raised2m 41s
-
(Locked)
What is a fixture?3m 18s
-
(Locked)
Using fixture2m 38s
-
(Locked)
Skipping a test, with good reasons3m 17s
-
(Locked)
Checkpoint: What you have so far2m 1s
-
-
-
-
-