CodeX
Published in

CodeX

Tree in Africa
Photo by on

Pytest’s assert is not what you think it is

What is AST? And how pytest hacks it to give you a better UX?

In Python, like many other languages, there is a statement that checks a given condition, and raises an AssertionError if this condition is False, otherwise, it does nothing if the given condition is True. That’s basically what assert does.

--

--

--

Everything connected with Tech & Code. Follow to join our 900K+ monthly readers

Recommended from Medium

Implement Local Notifications in Ionic 5 with Capacitor

Implement Local Notifications in Ionic 5 with Capacitor

Retrofit — Mock service with an interceptor

A pc monitor with codes written, in ThinkUp´s offices

E-mail validation makes for another good example of TDD in Java

Pausing & Quitting the game in Unity

[Help]Play MCS with your friends in the Arena!

Pointer receiver methods and iteration variables

Best Online Video Editor: Lumen5

Day 17 —More Core Programming

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Tarek Amr

Tarek Amr

I write about what machines can learn from data, what humans can learn from machines, and what businesses can learn from all three.

More from Medium

Python — Type Annotation for Functions and Class

The Unexpected Workings of Python’s Default Arguments

Using SonarQube to analyse Python code

pandas results in SonarQube

Iterator Functions