Skip SSL download test if SSL is not supported

This makes the testsuite pass entirely with a PyPI PyQt and OpenSSL 1.1
This commit is contained in:
Florian Bruhin 2017-09-16 09:40:04 +02:00
parent 3179e8c7b9
commit 0aa85f5967
2 changed files with 9 additions and 1 deletions

View File

@ -92,7 +92,8 @@ Feature: Downloading things from a website.
Then no crash should happen
Scenario: Downloading with SSL errors (issue 1413)
When I clear SSL errors
When SSL is supported
And I clear SSL errors
And I set content.ssl_strict to ask
And I set downloads.location.prompt to false
And I download an SSL page

View File

@ -23,6 +23,7 @@ import shlex
import pytest
import pytest_bdd as bdd
from PyQt5.QtNetwork import QSslSocket
bdd.scenarios('downloads.feature')
@ -54,6 +55,12 @@ def clean_old_downloads(quteproc):
quteproc.send_cmd(':download-clear')
@bdd.when("SSL is supported")
def check_ssl():
if not QSslSocket.supportsSsl():
pytest.skip("QtNetwork SSL not supported")
@bdd.when("the unwritable dir is unwritable")
def check_unwritable(tmpdir):
unwritable = tmpdir / 'downloads' / 'unwritable'