Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pytest-mock tutorial

import pytest
from src.calc import add


@pytest.mark.parametrize("a,b,expected",
							[(10, 5, 15),
							(-1, 1, 0),
							(-1, -1, -2)])
def test_add(a, b, expected):
	assert add(a, b) == expected
Source by blogs.sap.com #
 
PREVIOUS NEXT
Tagged: #tutorial
ADD COMMENT
Topic
Name
2+1 =