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:
parent
3179e8c7b9
commit
0aa85f5967
@ -92,7 +92,8 @@ Feature: Downloading things from a website.
|
|||||||
Then no crash should happen
|
Then no crash should happen
|
||||||
|
|
||||||
Scenario: Downloading with SSL errors (issue 1413)
|
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 content.ssl_strict to ask
|
||||||
And I set downloads.location.prompt to false
|
And I set downloads.location.prompt to false
|
||||||
And I download an SSL page
|
And I download an SSL page
|
||||||
|
@ -23,6 +23,7 @@ import shlex
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytest_bdd as bdd
|
import pytest_bdd as bdd
|
||||||
|
from PyQt5.QtNetwork import QSslSocket
|
||||||
bdd.scenarios('downloads.feature')
|
bdd.scenarios('downloads.feature')
|
||||||
|
|
||||||
|
|
||||||
@ -54,6 +55,12 @@ def clean_old_downloads(quteproc):
|
|||||||
quteproc.send_cmd(':download-clear')
|
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")
|
@bdd.when("the unwritable dir is unwritable")
|
||||||
def check_unwritable(tmpdir):
|
def check_unwritable(tmpdir):
|
||||||
unwritable = tmpdir / 'downloads' / 'unwritable'
|
unwritable = tmpdir / 'downloads' / 'unwritable'
|
||||||
|
Loading…
Reference in New Issue
Block a user