mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
Avoid reusing accounts between tests
Add time as a prefix.
This commit is contained in:
@@ -4,6 +4,7 @@ import imaplib
|
||||
import smtplib
|
||||
import itertools
|
||||
import pytest
|
||||
import time
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -49,12 +50,13 @@ class SmtpConn:
|
||||
|
||||
@pytest.fixture
|
||||
def gencreds(maildomain):
|
||||
prefix = str(time.time())
|
||||
count = itertools.count()
|
||||
|
||||
def gen():
|
||||
while 1:
|
||||
num = next(count)
|
||||
yield f"user{num}@{maildomain}", f"password{num}"
|
||||
yield f"user{prefix}_{num}@{maildomain}", f"password{prefix}_{num}"
|
||||
|
||||
return lambda: next(gen())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user