Skip to main content

Debug & Test

Unit Test

Pytest

Debugging

assert
  • assert <condition>, <message> : 如果 condition 為 True,沒有作用;如果為 False,會產生錯誤,並顯示訊息
x = 5
assert x == 5, "x should be 5"