From 2f2b563e91ea6e18fe6cd3e9087f2fd0b2e2beee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20Andr=C3=A9?= Date: Tue, 23 Mar 2021 16:06:58 +0100 Subject: [PATCH] add_2 function and its test --- core.py | 6 +++++- test_core.py | 12 +++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/core.py b/core.py index 3c57548..70f521a 100644 --- a/core.py +++ b/core.py @@ -1,3 +1,7 @@ def add(x, y, z=0): """Add two (or three) objects""" - return x + y + z \ No newline at end of file + return x + y + z + +def add_2(x): + """Add two to a number""" + return x + 2 \ No newline at end of file diff --git a/test_core.py b/test_core.py index 421dd7b..7d73ac7 100644 --- a/test_core.py +++ b/test_core.py @@ -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 \ No newline at end of file