From ac9b0e5c598b18495160fcee2c588a78507996a1 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 17 Feb 2017 22:07:23 +0100 Subject: [PATCH] bdd: Allow checking open tabs without (active) --- tests/end2end/features/conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/end2end/features/conftest.py b/tests/end2end/features/conftest.py index 789fda108..01afa499f 100644 --- a/tests/end2end/features/conftest.py +++ b/tests/end2end/features/conftest.py @@ -536,6 +536,9 @@ def check_open_tabs(quteproc, request, tabs): assert len(session['windows']) == 1 assert len(session['windows'][0]['tabs']) == len(tabs) + # If we don't have (active) anywhere, don't check it + has_active = any(line.endswith(active_suffix) for line in tabs) + for i, line in enumerate(tabs): line = line.strip() assert line.startswith('- ') @@ -551,7 +554,7 @@ def check_open_tabs(quteproc, request, tabs): assert session_tab['history'][-1]['url'] == quteproc.path_to_url(path) if active: assert session_tab['active'] - else: + elif has_active: assert 'active' not in session_tab