calculations.py

In [2]:
def calc_total(a,b):
    return a+b

def calc_multiply(a,b):
    return a*b

test_caculations.py

In [3]:
import pytest
import calculations #the name of your other python file you are testing

def test_calc_total():
    total = calculations.calc_total(4,5)
    assert total == 9
    
def test_calc_multiply():
    result = calculations.calc_multiply(40, 10)
    assert result == 400
    
In [ ]:
#run 'phython -m pytest' to find any files with 'test_' prefix & run them
#or
#run 'py.test -v'