remove more compat code
This commit is contained in:
parent
662c245795
commit
57d628ca74
9 changed files with 37 additions and 89 deletions
|
|
@ -589,16 +589,11 @@ def test_run_cert_import(monkeypatch):
|
|||
with pytest.raises(click.BadParameter):
|
||||
run_command.make_context("run", ["--cert", "not_here"])
|
||||
|
||||
# not an SSLContext
|
||||
if sys.version_info >= (2, 7, 9):
|
||||
with pytest.raises(click.BadParameter):
|
||||
run_command.make_context("run", ["--cert", "flask"])
|
||||
with pytest.raises(click.BadParameter):
|
||||
run_command.make_context("run", ["--cert", "flask"])
|
||||
|
||||
# SSLContext
|
||||
if sys.version_info < (2, 7, 9):
|
||||
ssl_context = object()
|
||||
else:
|
||||
ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
|
||||
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
|
||||
|
||||
monkeypatch.setitem(sys.modules, "ssl_context", ssl_context)
|
||||
ctx = run_command.make_context("run", ["--cert", "ssl_context"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue