Writing automated tests for Python command-line apps and scripts

preview_player
Показать описание

Two techniques for writing automated tests for your Python command-line applications and scripts.

In this video you'll see how to structure the entry points of your Python command-line scripts in order to make them easier to test with unit and integration tests using Python's unittest library.

See examples of how these techniques are implemented in the project I show in the video:

This project gives you a blueprint for writing testable Python scripts and shows you how to run these tests on a build server (Jenkins, TravisCI, CircleCI, ...) using the pytest test runner.

Interested in the mypy type checker and the Python type annotations that appear in the video? This tutorial will help you get set up:

* * *

FREE Python Tutorials & News:
Рекомендации по теме
Комментарии
Автор

Dude, your tutorials are amazing. You and Corey Schafer are the best. Thank you so much!

kRyStLGaMeR
Автор

sorry kind of new to python
Why are you sending variables in this way ? def move_file(root_folder: str, path: str) ?
Wouldn't def move_file (root_folder, path) work in the same way ?
Is this some sort of validation for a string ?

allgreatthings
Автор

thanks! i'm from go but this was useful

ulissemini
Автор

*facepalm* so simple... thanks! i almost feel stupid now :))

brainstroem