July 24, 2023, 4:42 p.m. | Naomi Kriger

Towards Data Science - Medium towardsdatascience.com

Beyond Basics: Advanced Python Exception Testing for Pytest and Unittest

image by chenspec on pixabay

Testing exceptions is more than just a formality - it’s an essential part of writing reliable code. In this tutorial, we will explore practical and effective methods to test Python code that raises and does not raise exceptions, verifying the accuracy of the exception messages, and covering both pytest and unittest, with and without parameterized tests for each framework.

By the end of this tutorial, …

advanced basics beyond code coding exception explore part practical pytest python raises software development software engineering test testing tutorial writing

Senior Machine Learning Engineer

@ GPTZero | Toronto, Canada

ML/AI Engineer / NLP Expert - Custom LLM Development (x/f/m)

@ HelloBetter | Remote

Doctoral Researcher (m/f/div) in Automated Processing of Bioimages

@ Leibniz Institute for Natural Product Research and Infection Biology (Leibniz-HKI) | Jena

Seeking Developers and Engineers for AI T-Shirt Generator Project

@ Chevon Hicks | Remote

Principal Data Architect - Azure & Big Data

@ MGM Resorts International | Home Office - US, NV

GN SONG MT Market Research Data Analyst 11

@ Accenture | Bengaluru, BDC7A