mirror of
https://github.com/chatmail/relay.git
synced 2026-05-18 20:08:21 +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 smtplib
|
||||||
import itertools
|
import itertools
|
||||||
import pytest
|
import pytest
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
@@ -49,12 +50,13 @@ class SmtpConn:
|
|||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def gencreds(maildomain):
|
def gencreds(maildomain):
|
||||||
|
prefix = str(time.time())
|
||||||
count = itertools.count()
|
count = itertools.count()
|
||||||
|
|
||||||
def gen():
|
def gen():
|
||||||
while 1:
|
while 1:
|
||||||
num = next(count)
|
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())
|
return lambda: next(gen())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user