How do I run multiple commands after calling an assert statement? For example, here's what I would like to do (without using assert):
x = False
if x != True:
my_func()
raise ValueError("My statement")
This does exactly what I want, but it seems more Pythonic to use assert in this case. I cannot figure out how to do multiple things after calling assert. Here's what I'm trying to do (but with incorrect syntax):
x = False
assert x == True, my_func() "My statement"
assert x == True, [my_func(), "My statement"][1]