Avoid reusing accounts between tests

Add time as a prefix.
This commit is contained in:
link2xt
2023-10-15 20:17:11 +00:00
parent 2a59cd4702
commit a107fb3cca

View File

@@ -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())