From e4e02ea3c0be710ed1b0f566c0bb680b3ba7ab46 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Mon, 2 May 2022 10:27:34 +0200 Subject: [PATCH] improve error messages during live creation of accounts --- python/src/deltachat/testplugin.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/python/src/deltachat/testplugin.py b/python/src/deltachat/testplugin.py index d47f3de85..5f7ecd7e0 100644 --- a/python/src/deltachat/testplugin.py +++ b/python/src/deltachat/testplugin.py @@ -155,19 +155,21 @@ class TestProcess: yield from iter(configlist) else: - for index in range(10): + MAX_LIVE_CREATED_ACCOUNTS = 10 + for index in range(MAX_LIVE_CREATED_ACCOUNTS): try: yield configlist[index] except IndexError: res = requests.post(liveconfig_opt) if res.status_code != 200: - pytest.fail("creat newtmpuser failed {}: '{}'".format( - res.status_code, res.text)) + pytest.fail("newtmpuser count={} code={}: '{}'".format( + index, res.status_code, res.text)) d = res.json() config = dict(addr=d["email"], mail_pw=d["password"]) + print("newtmpuser {}: addr={}".format(index, config["addr"])) configlist.append(config) yield config - pytest.fail("more than 10 live accounts requested. Is a test running wild?") + pytest.fail("more than {} live accounts requested.".format(MAX_LIVE_CREATED_ACCOUNTS)) @pytest.fixture