Created
July 3, 2012 16:31
-
-
Save colltoaction/3040847 to your computer and use it in GitHub Desktop.
Una función en python para mostrar cómo testear una función de forma sencilla
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def funcion_que_prueba_la_suma(): | |
suma = 1 + 2 | |
assert suma == 3, 'La suma no funciona correctamente, su resultado fue ' + str(suma) + ', distinto de 3' | |
# si el assert no corta la ejecución, entonces funcionó bien | |
print 'La suma funciona correctamente' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment