tests: fully type the test suite (#2794)
* tests: fully type the test suite * chore: require more typing Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: Henry Schreiner <henryfs@princeton.edu> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
parent
643b30c796
commit
097806b6b1
@@ -1,4 +1,5 @@
|
||||
import ssl
|
||||
from pathlib import Path
|
||||
|
||||
import certifi
|
||||
import pytest
|
||||
@@ -8,21 +9,21 @@ from cibuildwheel.util.file import download
|
||||
DOWNLOAD_URL = "https://cdn.jsdelivr.net/gh/pypa/cibuildwheel@v1.6.3/requirements-dev.txt"
|
||||
|
||||
|
||||
def test_download(monkeypatch, tmp_path):
|
||||
def test_download(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
|
||||
monkeypatch.delenv("SSL_CERT_FILE", raising=False)
|
||||
dest = tmp_path / "file.txt"
|
||||
download(DOWNLOAD_URL, dest)
|
||||
assert len(dest.read_bytes()) == 134
|
||||
|
||||
|
||||
def test_download_good_ssl_cert_file(monkeypatch, tmp_path):
|
||||
def test_download_good_ssl_cert_file(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
|
||||
monkeypatch.setenv("SSL_CERT_FILE", certifi.where())
|
||||
dest = tmp_path / "file.txt"
|
||||
download(DOWNLOAD_URL, dest)
|
||||
assert len(dest.read_bytes()) == 134
|
||||
|
||||
|
||||
def test_download_bad_ssl_cert_file(monkeypatch, tmp_path):
|
||||
def test_download_bad_ssl_cert_file(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
|
||||
bad_cafile = tmp_path / "ca.pem"
|
||||
bad_cafile.write_text("bad certificates")
|
||||
monkeypatch.setenv("SSL_CERT_FILE", str(bad_cafile))
|
||||
|
||||
Reference in New Issue
Block a user