Skip to content

Commit

Permalink
pytest skips
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Van Eck <[email protected]>
  • Loading branch information
pvaneck committed Sep 12, 2024
1 parent 9d90e56 commit c4dfbbc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sdk/identity/azure-identity/tests/test_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import sys

from azure.core.credentials import SupportsTokenInfo, TokenCredential
from azure.identity import (
Expand All @@ -24,6 +25,7 @@
AzureDeveloperCliCredential,
AzurePipelinesCredential,
)
import pytest


def test_credential_is_token_credential():
Expand All @@ -47,6 +49,10 @@ def test_credential_is_token_credential():
assert isinstance(AzurePipelinesCredential, TokenCredential)


@pytest.mark.skipif(
sys.version_info < (3, 9),
reason="isinstance check doesn't seem to work when the Protocol subclasses ContextManager in Python <=3.8",
)
def test_credential_is_supports_token_info():
assert isinstance(AuthorizationCodeCredential, SupportsTokenInfo)
assert isinstance(CertificateCredential, SupportsTokenInfo)
Expand Down
11 changes: 11 additions & 0 deletions sdk/identity/azure-identity/tests/test_initialization_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import sys

from azure.core.credentials_async import AsyncSupportsTokenInfo, AsyncTokenCredential
from azure.identity.aio import (
AuthorizationCodeCredential,
Expand All @@ -20,8 +22,13 @@
AzureDeveloperCliCredential,
AzurePipelinesCredential,
)
import pytest


@pytest.mark.skipif(
sys.version_info < (3, 9),
reason="isinstance check doesn't seem to work when the Protocol subclasses AsyncContextManager in Python <=3.8",
)
def test_credential_is_async_token_credential():
assert isinstance(AuthorizationCodeCredential, AsyncTokenCredential)
assert isinstance(CertificateCredential, AsyncTokenCredential)
Expand All @@ -40,6 +47,10 @@ def test_credential_is_async_token_credential():
assert isinstance(AzurePipelinesCredential, AsyncTokenCredential)


@pytest.mark.skipif(
sys.version_info < (3, 9),
reason="isinstance check doesn't seem to work when the Protocol subclasses AsyncContextManager in Python <=3.8",
)
def test_credential_is_async_supports_token_info():
assert isinstance(AuthorizationCodeCredential, AsyncSupportsTokenInfo)
assert isinstance(CertificateCredential, AsyncSupportsTokenInfo)
Expand Down

0 comments on commit c4dfbbc

Please sign in to comment.