chore: apply flake8-pytest-style linter rules (#8307)

This commit is contained in:
Bowen Liang 2024-09-12 18:09:16 +08:00 • committed by GitHub
commit 8815511ccb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 23 additions and 23 deletions

View file

@ -1,3 +1,5 @@
import pytest
from libs.helper import email
@ -9,17 +11,11 @@ def test_email_with_valid_email():
def test_email_with_invalid_email():
try:
with pytest.raises(ValueError, match="invalid_email is not a valid email."):
email("invalid_email")
except ValueError as e:
assert str(e) == "invalid_email is not a valid email."
try:
with pytest.raises(ValueError, match="@example.com is not a valid email."):
email("@example.com")
except ValueError as e:
assert str(e) == "@example.com is not a valid email."
try:
with pytest.raises(ValueError, match="()@example.com is not a valid email."):
email("()@example.com")
except ValueError as e:
assert str(e) == "()@example.com is not a valid email."