add ping-pong bench and formatting

This commit is contained in:
holger krekel
2023-10-20 10:28:16 +02:00
parent ae2651c441
commit 115a07aecf
2 changed files with 17 additions and 2 deletions

View File

@@ -68,9 +68,10 @@ def benchmark(request):
for i in range(num):
now = time.time()
func()
durations.append(time.time()-now)
durations.append(time.time() - now)
durations.sort()
request.config._benchresults[name] = durations
return bench
@@ -84,7 +85,6 @@ def pytest_terminal_summary(terminalreporter):
tr.write_line(f"{name: <30} {median:2.4f} seconds")
@pytest.fixture
def imap(maildomain):
return ImapConn(maildomain)