From 6884950c5b6bb6625ddb35324e5aab0d87bd5a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jim=20Br=C3=A4nnlund?= Date: Fri, 17 Aug 2018 23:38:25 +0200 Subject: [PATCH] make crossbrowsertesting tests more robust --- testing/test_crossbrowsertesting.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/testing/test_crossbrowsertesting.py b/testing/test_crossbrowsertesting.py index 520f08b4..e3fa679a 100644 --- a/testing/test_crossbrowsertesting.py +++ b/testing/test_crossbrowsertesting.py @@ -59,11 +59,15 @@ def test_invalid_credentials_env(failure, monkeypatch, tmpdir, username, key): monkeypatch.setattr(os.path, 'expanduser', lambda p: str(tmpdir)) monkeypatch.setenv(username, 'foo') monkeypatch.setenv(key, 'bar') - failure('--capability', 'browser_api_name', 'FF46') + out = failure('--capability', 'browser_api_name', 'FF46') + messages = ['missing auth', 'basic auth failed'] + assert any(message in out for message in messages) def test_invalid_credentials_file(failure, monkeypatch, tmpdir): monkeypatch.setattr(os.path, 'expanduser', lambda p: str(tmpdir)) config = tmpdir.join('.crossbrowsertesting') config.write('[credentials]\nusername=foo\nkey=bar') - failure('--capability', 'browser_api_name', 'FF46') + out = failure('--capability', 'browser_api_name', 'FF46') + messages = ['missing auth', 'basic auth failed'] + assert any(message in out for message in messages)