Special offers now — see discounted courses.
day
:
hour
:
min
:
sec
See special offers
Unit Testing in Python

Unit Testing in Python

1h 29mAdvanced2020-03-03

Authors

Jasmine Omeke

Jasmine Omeke

Software Developer and Former Fulbright Scholar

Course details

Unit testing—which involves testing small, isolatable pieces of code—can help you catch and fix bugs before they crop up in your final product. And by adopting test-driven development (TDD) and writing unit tests before production code, you can take even greater responsibility for your project's quality. Curious about how to best approach unit testing in your own Python projects? This course shows you how. Join instructor Jasmine Omeke as she goes over TDD techniques for Python projects using the pytest testing framework and a Docker container.

Jasmine begins by providing a basic overview of both TDD and pytest as she shows how to write a basic test. She then delves into how to use pytest features to automatically run unit tests, as well as how to best organize your pytest projects. Then, see how to hop into an existing project and use pytest tests to figure out the core behavior of the source code, determine which source code functions still need to be tested, and add in more tests.

Skills covered

Software TestingPythonProgramming LanguagesOpen SourceSoftware DevelopmentDeep Dive (X:Y)

Concepts

0. Introduction

  • 01 - Python unit testing with pytest
  • 02 - Why pytest
  • 03 - Roadmap
  • 04 - Exercise files

1. Installation and Setup

  • 05 - Docker and VS Code (Mac)
  • 06 - Docker and VS Code (PC)
  • 07 - Running pytest with Docker

2. Overview of Test-Driven Development and Pytest Features

  • 08 - Overview of TDD
  • 09 - Basic tests and assertions
  • 10 - Exceptions
  • 11 - Challenge - Exceptions
  • 12 - Solution - Exceptions
  • 13 - Happy path testing
  • 14 - Sad path testing

3. Test Automation with Fixtures and Parametrization

  • 15 - Fixtures to amortize costly operations
  • 16 - Factory fixtures
  • 17 - Parametrization
  • 18 - Challenge - Parametrization
  • 19 - Solution - Parameterization

4. Organizing Your Pytest Project

  • 20 - Using Conftest.py for common functions
  • 21 - Modularizing conftest.py

5. Using Pytest with an Existing Project

  • 22 - Reading tests to surmise behavior
  • 23 - Challenge - Adding test coverage
  • 24 - Solution - Adding test coverage

Conclusion

  • 25 - Next steps

Related courses

Related learn paths

About us

LyndaKade is a leading learning platform that helps people learn business, software, technology, and creative skills to achieve personal and professional goals.

Phone numberAparat ChannelTelegram SupportTelegram ChannelInstagram Page

All rights to this site belong to LyndaKade.

Terms of Service|Privacy Policy

نماد الکترونیک enamad در صورت اتصال با آی‌پی داخل کشور، نمایش داده خواهد شد.
logo-samandehi - لوگو ساماندهی
zarinpal
zibal