From 9e64e5eab4aa59663441465c7458125cdc185fb4 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 7 May 2016 22:39:09 +0200 Subject: [PATCH] Check CommandError exception value --- tests/unit/browser/test_adblock.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/unit/browser/test_adblock.py b/tests/unit/browser/test_adblock.py index 0fdb6592c..38bb6b77b 100644 --- a/tests/unit/browser/test_adblock.py +++ b/tests/unit/browser/test_adblock.py @@ -249,8 +249,11 @@ def test_without_datadir(config_stub, tmpdir, monkeypatch, win_registry): } monkeypatch.setattr('qutebrowser.utils.standarddir.data', lambda: None) host_blocker = adblock.HostBlocker() - with pytest.raises(cmdexc.CommandError): + + with pytest.raises(cmdexc.CommandError) as excinfo: host_blocker.adblock_update(0) + assert str(excinfo.value) == "No data storage is configured!" + host_blocker.read_hosts() for str_url in URLS_TO_CHECK: assert not host_blocker.is_blocked(QUrl(str_url))