Use os.getenv() instead of os.environ

If ECDSAP256SHA256_SUPPORTED or ECDSAP384SHA384_SUPPORTED variables were
not present in the environment, os.environ would raise KeyError that is
not being handled in the decorator. Use os.getenv() instead.
This commit is contained in:
Michal Nowak
2024-12-05 10:37:19 +01:00
parent 2a7b8d9795
commit 1a5683b638

View File

@@ -38,7 +38,7 @@ def check_server_soa(resolver):
@pytest.mark.skipif(
not os.environ["ECDSAP256SHA256_SUPPORTED"],
not os.getenv("ECDSAP256SHA256_SUPPORTED"),
reason="algorithm ECDSA256 not supported",
)
def test_ecdsa256():
@@ -46,7 +46,7 @@ def test_ecdsa256():
@pytest.mark.skipif(
not os.environ["ECDSAP384SHA384_SUPPORTED"],
not os.getenv("ECDSAP384SHA384_SUPPORTED"),
reason="algorithm ECDSA384 not supported",
)
def test_ecdsa384():