From fc755c104b55aae7462d7fcc7b8d7be3616efd95 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 6 Jan 2016 07:42:33 +0100 Subject: [PATCH] bdd: Add test for exception with :pyeval. --- tests/integration/features/conftest.py | 2 +- tests/integration/features/misc.feature | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/integration/features/conftest.py b/tests/integration/features/conftest.py index a5fd3d98d..3c5f0fb38 100644 --- a/tests/integration/features/conftest.py +++ b/tests/integration/features/conftest.py @@ -323,7 +323,7 @@ def check_contents(quteproc, filename): def check_contents(quteproc, text): """Check the current page's content.""" content = quteproc.get_content().strip() - assert content == text + assert text in content @bdd.then(bdd.parsers.parse("the following tabs should be open:\n{tabs}")) diff --git a/tests/integration/features/misc.feature b/tests/integration/features/misc.feature index 9d2c334e6..c45066c85 100644 --- a/tests/integration/features/misc.feature +++ b/tests/integration/features/misc.feature @@ -299,6 +299,11 @@ Feature: Various utility commands. And I wait until qute:pyeval is loaded Then the page should contain the plaintext "2" + Scenario: Causing exception in :pyeval + When I run :debug-pyeval 1/0 + And I wait until qute:pyeval is loaded + Then the page should contain the plaintext "ZeroDivisionError" + Scenario: Running :pyeval with --quiet When I run :debug-pyeval --quiet 1+1 Then "pyeval output: 2" should be logged