Page MenuHomeDevCentral

Unit_testing_with_pytest

Authored By
dereckson
Apr 11 2015, 15:17
Size
237 B
Referenced Files
None
Subscribers
None

Unit_testing_with_pytest

def add(a, b):
"""Adds two numbers."""
return a + b
def test_add():
"""Tests add method."""
assert add(0, 0) == 0
assert add(2, 0) == 2
assert add(0, 2) == 2
assert add(3, 4) == 7
assert add(-3, 2) == -1

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1742
Default Alt Text
Unit_testing_with_pytest (237 B)

Event Timeline