Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion core.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
def add(x, y, z=0):
"""Add two (or three) objects"""
return x + y + z
return x + y + z

def add_2(x):
"""Add two to a number"""
return x + 2
12 changes: 9 additions & 3 deletions test_core.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
from core import add
from core import *


def test_add():
"""Check that `add()` works as expected"""

assert add(2, 3) == 5


def test_add_z():
"""Check that `add()` works as expected"""

assert add(2, 3, 1) == 6


def test_add_2():
"""Check that `add()` works as expected"""

assert add_2(3) == 5