Python Unit vs. Functional Testing: Understanding the Difference + Practical Example

Publié le: 19 mai 2023
sur la chaîne: Pybites
1,409
26

In this video, we explore the difference between unit and functional testing, using the Git Stats project, hosted on our PyBites Open Source org.

Unit testing involves testing individual components in isolation, such as functions or class modules, while functional testing focuses on testing the functionality of the system as a whole and how different components interact.

We demonstrate running both unit tests and functional tests on our Git Stats project, showcasing the significant speed difference between the two.

To effectively organize and run tests, we recommend using separate folders (packages) for unit and functional tests, allowing developers to easily isolate and execute specific sets of tests (e.g. using pytest -k).

We hope this video helps you distinguish better between these two types of testing and gives you an idea how you can structure your code better. As unit testing often involves mocking, we can do a follow up video on that, or anything you want a deep dive on. Just comment below ...

Links:
Git Stats project: https://github.com/PyBites-Open-Sourc...
Pybites open source: https://github.com/PyBites-Open-Source
pytest profiling test execution duration: https://docs.pytest.org/en/latest/how...

---
Learn more about Pybites / what we do: https://pybit.es

Get our weekly developer / mindset emails: https://pybit.es/friends/

Join our Slack community: https://pybit.es/community/

And last but not least, we appreciate any feedback to make our YouTube content better 💡
https://form.jotform.com/230941798741062 🙏


Sur cette page du site, vous pouvez voir la vidéo en ligne Python Unit vs. Functional Testing: Understanding the Difference + Practical Example durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Pybites 19 mai 2023, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,409 fois et il a aimé 26 téléspectateurs. Bon visionnage!