Skip to content

Instantly share code, notes, and snippets.

@HectorTorres
Created January 11, 2023 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HectorTorres/77e356e008686503122ace8a8e0fa8fe to your computer and use it in GitHub Desktop.
Save HectorTorres/77e356e008686503122ace8a8e0fa8fe to your computer and use it in GitHub Desktop.
import math
def function_square(a):
return a*a
def function_square_root(a):
return math.sqrt(a)
def function_sum(a,b):
return a+b
def test_function_square():
assert function_square(2) == 4
def test_function_square_root():
assert function_square_root(16) == 4
def test_function_sum():
assert function_sum(2,3) == 5
test_function_square()
test_function_square()
test_function_sum()
#Run the file
#pytest test_pytest_02.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment