瀏覽代碼

Merge pull request #2350 from pini-gh/pini-support-more-python-versions

Fix test case assertion depending on python version
Nicolas Duchon 1 年之前
父節點
當前提交
a8478d10da
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      test/test_ssl/wildcard_cert_and_nohttps/test_wildcard_cert_nohttps.py

+ 2 - 1
test/test_ssl/wildcard_cert_and_nohttps/test_wildcard_cert_nohttps.py

@@ -27,7 +27,8 @@ def test_https_get_served(docker_compose, nginxproxy, subdomain):
 def test_https_request_to_nohttps_vhost_goes_to_fallback_server(docker_compose, nginxproxy):
     with pytest.raises( (CertificateError, SSLError) ) as excinfo:
         nginxproxy.get("https://3.web.nginx-proxy.tld/port")
-    assert """certificate is not valid for '3.web.nginx-proxy.tld'""" in str(excinfo.value)
+    assert """certificate is not valid for '3.web.nginx-proxy.tld'""" in str(excinfo.value) or \
+           """hostname '3.web.nginx-proxy.tld' doesn't match 'nginx-proxy.tld'""" in str(excinfo.value)
 
     r = nginxproxy.get("https://3.web.nginx-proxy.tld/port", verify=False)
     assert r.status_code == 503