[PYTHON] Jupyter Study Note_007

Try pytest on google colab

Follow the procedure below

--Prepare the source code --Naming rules --Make the method start with "test" --Judge whether the result is OK or NG from the result of the assert conditional expression

pytest01.py


def add(a, b):
    return a + b

def sub(a, b):
    return a - b

test_pytest01.py


from pytest01 import add, sub

def test_add():
    assert add(1, 2) == 4 #Become NG

def test1_sub():
    assert sub(3, 1) == 2 #Become OK

def atest_sub():
    assert sub(3, 1) == 2 #pytest cannot be recognized

--Results of implementation 実施結果

Recommended Posts

Jupyter Study Note_002
Jupyter Study Note_003
Jupyter Study Note_007
Jupyter Study Note_005
Python study note_004
Python study note_003
Jupyter study notes_008
Jupyter study notes_004
Jupyter study notes_001
Note
Note
Note
[WIP] Fluent Python Study Note
Study Note 9_Install Jenkins on CentOS7
Django note 4
pyenv note
Jupyter begins
Jupyter Tips 4
GroupBy Note
"Python Machine Learning Programming" Summary Note (Jupyter)
Jupyter Tips 3
argparse note
Django Note 5
Jupyter Tips 2
Note: Python
Ansible Note
Jupyter installation
Jupyter tricks
Python note
Django Note 1
direnv note
Django note 3
Django note 2
[Note] RepresenterError
Install and set Jupyter Notebook to create a study note creation environment [Mac]