Testing – Solution [1]

import pytest

def find_rectangle_perimeter(width, height):
    """ Calculate perimeter of a rectangle from the given sides.
    """
    if width < 0 or height < 0:
        raise ValueError("Rectangle sides must be non-negative.")
    return  2 * (width + height)

def test_find_perimeter_exception_negative():
    """ Tests of negative integer values as input
    """
    with pytest.raises(ValueError):
        find_rectangle_perimeter(-3, 5)