Ensure that *everything* is typed in community.crypto (#917)

* Ensure that *everything* is typed in community.crypto.

* Fix comment.

* Ignore type definitions/imports and AssertionErrors for code coverage.
This commit is contained in:
Felix Fontein
2025-06-09 10:10:19 +02:00
committed by GitHub
parent ec063d8515
commit d83a923325
73 changed files with 494 additions and 317 deletions

View File

@@ -5,6 +5,7 @@
from __future__ import annotations
import base64
import pathlib
import re
import subprocess
@@ -104,7 +105,7 @@ def test_serialize_asn1_string_as_der_invalid_type() -> None:
@pytest.mark.skip() # This is to just to build the test case assertions and shouldn't run normally.
@pytest.mark.parametrize("value, expected", TEST_CASES)
def test_test_cases(value: str, expected: bytes, tmp_path) -> None:
def test_test_cases(value: str, expected: bytes, tmp_path: pathlib.Path) -> None:
test_file = tmp_path / "test.der"
subprocess.run(
["openssl", "asn1parse", "-genstr", value, "-noout", "-out", test_file],