Skip to content
Snippets Groups Projects
Commit 12cb9f53 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

Prevent unit tests from sending emails

parent 780d52f2
No related branches found
No related tags found
No related merge requests found
...@@ -540,3 +540,9 @@ def responses(): ...@@ -540,3 +540,9 @@ def responses():
not_used = set(mocked_urls) - set(used_urls) not_used = set(mocked_urls) - set(used_urls)
if not_used: if not_used:
pytest.fail(f"Found unused responses mocks: {not_used}", pytrace=False) pytest.fail(f"Found unused responses mocks: {not_used}", pytrace=False)
@pytest.fixture(autouse=True)
def _no_mail(monkeypatch):
"""Remove sending mails from all tests."""
monkeypatch.delattr("smtplib.SMTP")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment