What is the meaning of the following expression:
assert "PASS" == res, msg
Which argument is being evaluated here?
What is the meaning of the following expression:
assert "PASS" == res, msg
Which argument is being evaluated here?
The assert
keyword is used when debugging the code.
This keyword test a condition (which is the first argument), if the condition returns false the program will give an AssertionError
, you can write the AssertionError
message (which is the second argument, separated with ,
).
Ex:
password = "hello"
assert password == "goodbye", "Access Denied"
output of the above code is:
AssertionError: Access Denied