MCPcopy Create free account
hub / github.com/JoshData/python-email-validator / test_email_unsafe_character

Function test_email_unsafe_character

tests/test_syntax.py:518–528  ·  view source on GitHub ↗
(s: str, expected_error: str)

Source from the content-addressed store, hash-verified

516 ],
517)
518def test_email_unsafe_character(s: str, expected_error: str) -> None:
519 # Check for various unsafe characters that are permitted by the email
520 # specs but should be disallowed for being unsafe or not sensible Unicode.
521
522 with pytest.raises(EmailSyntaxError) as exc_info:
523 validate_email(s + "@test", test_environment=True)
524 assert str(exc_info.value) == f"The email address contains unsafe characters: {expected_error}."
525
526 with pytest.raises(EmailSyntaxError) as exc_info:
527 validate_email("test@" + s, test_environment=True)
528 assert "The email address contains unsafe characters" in str(exc_info.value)
529
530
531@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

validate_emailFunction · 0.90

Tested by

no test coverage detected