Python Unit Testing: Testing Python Code Using pytest
Python 3.0+
| Intermediate
- 12 Videos | 1h 13m 26s
- Includes Assessment
- Earns a Badge
Explore several types of testing frameworks for Python applications, including the unittest framework, pytest, and doctest, in this 12-video course. First, you will learn how to define and run tests, and how to streamline tests by using fixtures. You will learn the important features of the pytest framework to create small test units, and to define and run individual tests. Next, you will learn to group tests into multiple scripts, and how to execute multiple test scripts within a single run. Learners will observe how to create a simple test, and learn to increase the complexity by defining test scripts to cover multiple tests for your application. You will explore the execution and skipping of specific tests in scripts, then learn to simplify tests by using parameterization. You will learn how to apply filters on different tests, and to execute tests with a certain string in the test name, and examine the use of markers in a test. Finally, you will learn how to use fixtures to run operations common to multiple tests.
WHAT YOU WILL LEARN
-
discover the key concepts covered in this coursewrite and execute a test using pytestexecute tests defined in multiple scripts using pytestpick the tests to execute based on the test function namesstop the execution of tests when there are a specific number of test failuresapply markers to tests and run only those tests which contain specific marker, and skip the execution of specific tests unconditionally
-
debug test scripts using the python debuggerparametrize calls to a function an application using the pytest parametrize decoratoruse fixtures to define common operations for test functionsapply module and function level scopes for fixtures functionsbundle fixture functions which are shared across scripts within a single conftest.py filesummarize the key concepts covered in this course
IN THIS COURSE
-
1.Course Overview2m 10sUP NEXT
-
2.An Introduction to pytest7m 7s
-
3.Running Multiple Tests using pytest8m 5s
-
4.Test Selection in pytest6m 53s
-
5.Halt Test Execution Based on Failures4m 30s
-
6.Test Markers and Skipping Tests8m 16s
-
7.Using the Python Debugger with pytest4m 48s
-
8.Parametrized Tests Using pytest7m 32s
-
9.Test Fixtures with pytest8m 45s
-
10.Setting the Scope for Test Fixtures7m 13s
-
11.The conftest.py File6m 28s
-
12.Course Summary1m 42s
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion of this course, which can be shared on any social network or business platform
Digital badges are yours to keep, forever.