Fix test_mhtml.py
This commit is contained in:
parent
2f0db878e6
commit
8dab1cf58a
@ -26,6 +26,15 @@ import pytest
|
|||||||
mhtml = pytest.importorskip('qutebrowser.browser.webkit.mhtml')
|
mhtml = pytest.importorskip('qutebrowser.browser.webkit.mhtml')
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
import cssutils
|
||||||
|
except (ImportError, re.error):
|
||||||
|
# Catching re.error because cssutils in earlier releases (<= 1.0) is
|
||||||
|
# broken on Python 3.5
|
||||||
|
# See https://bitbucket.org/cthedot/cssutils/issues/52
|
||||||
|
cssutils = None
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def patch_uuid(monkeypatch):
|
def patch_uuid(monkeypatch):
|
||||||
monkeypatch.setattr("uuid.uuid4", lambda: "UUID")
|
monkeypatch.setattr("uuid.uuid4", lambda: "UUID")
|
||||||
@ -248,8 +257,7 @@ def test_empty_content_type(checker):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('has_cssutils', [
|
@pytest.mark.parametrize('has_cssutils', [
|
||||||
pytest.mark.skipif(mhtml.cssutils is None,
|
pytest.mark.skipif(cssutils is None, reason="requires cssutils")(True),
|
||||||
reason="requires cssutils")(True),
|
|
||||||
False,
|
False,
|
||||||
], ids=['with_cssutils', 'no_cssutils'])
|
], ids=['with_cssutils', 'no_cssutils'])
|
||||||
@pytest.mark.parametrize('inline, style, expected_urls', [
|
@pytest.mark.parametrize('inline, style, expected_urls', [
|
||||||
|
Loading…
Reference in New Issue
Block a user