From the course: Create an Open-Source Project in Python
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Checkpoint: What you have so far - Python Tutorial
From the course: Create an Open-Source Project in Python
Checkpoint: What you have so far
- [Instructor] We have come to the end of this chapter so let's sum up what we have learned so far. First of all, we were introduced to pytest, a popular testing library and we used it to write some tests for our mock project. We explore some features of pytest such as parameterize which can combine similar tests into one test with multiple parameters, which helps tidy up your code. We have also learned how to test for expected exceptions and how to treat them appropriately. We also learned about fixture which allow us to take some elements that is irrelevant to the test out of the test itself. This makes managing the test much easier. Last but not least, we know what to do if we have tests that are expected to fail under certain conditions. We can then skip the test or mark it as known fail. This way, we can get past the test and not block further development. Now before we move on let's check if we still have all the…
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
-
-
-
-
-