From cfe3c69f00775fbd3fb5a5c7dc1bf37d048b1f79 Mon Sep 17 00:00:00 2001 From: VP- <898409+VP-@users.noreply.github.com> Date: Mon, 14 Oct 2019 15:04:29 +0200 Subject: [PATCH] Don't use hard-coded email addresses in tests --- python/tests/conftest.py | 5 +++++ python/tests/test_account.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/python/tests/conftest.py b/python/tests/conftest.py index 8ce4ebdfb..0523055e2 100644 --- a/python/tests/conftest.py +++ b/python/tests/conftest.py @@ -150,6 +150,11 @@ def acfactory(pytestconfig, tmpdir, request, session_liveconfig): lib.dc_set_config(ac._dc_context, b"configured", b"1") return ac + def peek_online_config(self): + if not session_liveconfig: + pytest.skip("specify DCC_PY_LIVECONFIG or --liveconfig") + return session_liveconfig.get(self.live_count) + def get_online_config(self): if not session_liveconfig: pytest.skip("specify DCC_PY_LIVECONFIG or --liveconfig") diff --git a/python/tests/test_account.py b/python/tests/test_account.py index 79c7871bb..7130befb6 100644 --- a/python/tests/test_account.py +++ b/python/tests/test_account.py @@ -389,7 +389,8 @@ class TestOnlineAccount: def test_one_account_send_bcc_setting(self, acfactory, lp): ac1 = acfactory.get_online_configuring_account() - c2 = ac1.create_contact(email="notexists@testrun.org") + ac2_config = acfactory.peek_online_config() + c2 = ac1.create_contact(email=ac2_config["addr"]) chat = ac1.create_chat_by_contact(c2) assert chat.id > const.DC_CHAT_ID_LAST_SPECIAL wait_successful_IMAP_SMTP_connection(ac1)