Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
import pytest @pytest.mark.parametrize("a,b,expected", [ (2, 3, 5), (0, 0, 0), (-1, 1, 0), (100, -50, 50), ]) def test_add(a, b, expected): assert a + b == expected @pytest.mark.parametrize("email", ["notanemail", "@bad.com", ""]) def test_invalid_emails(email): with pytest.raises(ValueError): validate_email(email)
Result
Open