remove more compat code

This commit is contained in:
David Lord 2020-04-04 09:25:54 -07:00
parent 662c245795
commit 57d628ca74
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
9 changed files with 37 additions and 89 deletions

View file

@ -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"])