Skip to content

Commit 7bfa10f

Browse files
author
Zim Kalinowski
committed
fixing async test
1 parent 71c04a2 commit 7bfa10f

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

sdk/resources/azure-mgmt-resource/tests/_aio_testcase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from unittest.mock import Mock
33

44
from azure.core.credentials import AccessToken
5-
from azure.identity.aio import DefaultAzureCredential
65
from devtools_testutils import AzureMgmtTestCase
76

87
class AzureMgmtAsyncTestCase(AzureMgmtTestCase):
@@ -16,6 +15,7 @@ def event_loop(self):
1615

1716
def create_mgmt_aio_client(self, client, **kwargs):
1817
if self.is_live:
18+
from azure.identity.aio import DefaultAzureCredential
1919
credential = DefaultAzureCredential()
2020
else:
2121
credential = Mock(get_token=asyncio.coroutine(lambda _: AccessToken("fake-token", 0)))
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# --------------------------------------------------------------------------
2+
#
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
#
5+
# The MIT License (MIT)
6+
#
7+
# Permission is hereby granted, free of charge, to any person obtaining a copy
8+
# of this software and associated documentation files (the ""Software""), to
9+
# deal in the Software without restriction, including without limitation the
10+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11+
# sell copies of the Software, and to permit persons to whom the Software is
12+
# furnished to do so, subject to the following conditions:
13+
#
14+
# The above copyright notice and this permission notice shall be included in
15+
# all copies or substantial portions of the Software.
16+
#
17+
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23+
# IN THE SOFTWARE.
24+
#
25+
# --------------------------------------------------------------------------
26+
import platform
27+
import sys
28+
29+
# Ignore async tests for Python < 3.5
30+
collect_ignore_glob = []
31+
if sys.version_info < (3, 5) or platform.python_implementation() == "PyPy":
32+
collect_ignore_glob.append("*_async.py")

0 commit comments

Comments
 (0)