Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-azure-core for 
openSUSE:Factory checked in at 2024-01-24 19:06:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-azure-core (Old)
 and      /work/SRC/openSUSE:Factory/.python-azure-core.new.16006 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-azure-core"

Wed Jan 24 19:06:06 2024 rev:46 rq:1141185 version:1.29.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-azure-core/python-azure-core.changes      
2024-01-04 16:01:32.053585946 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-azure-core.new.16006/python-azure-core.changes
   2024-01-24 19:06:27.649939306 +0100
@@ -1,0 +2,9 @@
+Fri Jan 19 09:14:19 UTC 2024 - John Paul Adrian Glaubitz 
<[email protected]>
+
+- New upstream release
+  + Version 1.29.7
+  + For detailed information about changes see the
+    CHANGELOG.md file provided with this package
+- Update Requires from setup.py
+
+-------------------------------------------------------------------

Old:
----
  azure-core-1.29.6.tar.gz

New:
----
  azure-core-1.29.7.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-azure-core.spec ++++++
--- /var/tmp/diff_new_pack.AtNwZx/_old  2024-01-24 19:06:28.257961241 +0100
+++ /var/tmp/diff_new_pack.AtNwZx/_new  2024-01-24 19:06:28.257961241 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-azure-core
 #
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -21,7 +21,7 @@
 %define skip_python2 1
 %endif
 Name:           python-azure-core
-Version:        1.29.6
+Version:        1.29.7
 Release:        0
 Summary:        Microsoft Azure Core Library for Python
 License:        MIT
@@ -34,8 +34,6 @@
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 Requires:       python-aiohttp >= 3.0
-Requires:       python-anyio < 5.0
-Requires:       python-anyio >= 3.0
 Requires:       python-azure-nspkg >= 3.0.0
 Requires:       python-requests >= 2.21.0
 Requires:       python-six >= 1.11.0

++++++ azure-core-1.29.6.tar.gz -> azure-core-1.29.7.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-core-1.29.6/CHANGELOG.md 
new/azure-core-1.29.7/CHANGELOG.md
--- old/azure-core-1.29.6/CHANGELOG.md  2023-12-13 21:06:44.000000000 +0100
+++ new/azure-core-1.29.7/CHANGELOG.md  2024-01-18 16:39:24.000000000 +0100
@@ -1,5 +1,11 @@
 # Release History
 
+## 1.29.7 (2024-01-18)
+
+### Other Changes
+
+- Removed dependency on `anyio`.  #33282
+
 ## 1.29.6 (2023-12-14)
 
 ### Bugs Fixed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-core-1.29.6/PKG-INFO 
new/azure-core-1.29.7/PKG-INFO
--- old/azure-core-1.29.6/PKG-INFO      2023-12-13 21:07:27.367552300 +0100
+++ new/azure-core-1.29.7/PKG-INFO      2024-01-18 16:40:05.470854300 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: azure-core
-Version: 1.29.6
+Version: 1.29.7
 Summary: Microsoft Azure Core Library for Python
 Home-page: 
https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/core/azure-core
 Author: Microsoft Corporation
@@ -20,7 +20,6 @@
 Requires-Python: >=3.7
 Description-Content-Type: text/markdown
 License-File: LICENSE
-Requires-Dist: anyio<5.0,>=3.0
 Requires-Dist: requests>=2.21.0
 Requires-Dist: six>=1.11.0
 Requires-Dist: typing-extensions>=4.6.0
@@ -192,7 +191,6 @@
 | logging_enable| Use to enable per operation. Defaults to `False`. |
 | logger | If specified, it will be used to log information. |
 | response_encoding | The encoding to use if known for this service (will 
disable auto-detection). |
-| proxies | Maps protocol or protocol and hostname to the URL of the proxy. |
 | raw_request_hook | Callback function. Will be invoked on request. |
 | raw_response_hook | Callback function. Will be invoked on response. |
 | network_span_namer | A callable to customize the span name. |
@@ -288,6 +286,12 @@
 
 # Release History
 
+## 1.29.7 (2024-01-18)
+
+### Other Changes
+
+- Removed dependency on `anyio`.  #33282
+
 ## 1.29.6 (2023-12-14)
 
 ### Bugs Fixed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-core-1.29.6/README.md 
new/azure-core-1.29.7/README.md
--- old/azure-core-1.29.6/README.md     2023-12-13 21:06:44.000000000 +0100
+++ new/azure-core-1.29.7/README.md     2024-01-18 16:39:24.000000000 +0100
@@ -163,7 +163,6 @@
 | logging_enable| Use to enable per operation. Defaults to `False`. |
 | logger | If specified, it will be used to log information. |
 | response_encoding | The encoding to use if known for this service (will 
disable auto-detection). |
-| proxies | Maps protocol or protocol and hostname to the URL of the proxy. |
 | raw_request_hook | Callback function. Will be invoked on request. |
 | raw_response_hook | Callback function. Will be invoked on response. |
 | network_span_namer | A callable to customize the span name. |
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-core-1.29.6/azure/core/_version.py 
new/azure-core-1.29.7/azure/core/_version.py
--- old/azure-core-1.29.6/azure/core/_version.py        2023-12-13 
21:06:44.000000000 +0100
+++ new/azure-core-1.29.7/azure/core/_version.py        2024-01-18 
16:39:24.000000000 +0100
@@ -9,4 +9,4 @@
 # regenerated.
 # --------------------------------------------------------------------------
 
-VERSION = "1.29.6"
+VERSION = "1.29.7"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-core-1.29.6/azure/core/pipeline/policies/_authentication_async.py 
new/azure-core-1.29.7/azure/core/pipeline/policies/_authentication_async.py
--- old/azure-core-1.29.6/azure/core/pipeline/policies/_authentication_async.py 
2023-12-13 21:06:44.000000000 +0100
+++ new/azure-core-1.29.7/azure/core/pipeline/policies/_authentication_async.py 
2024-01-18 16:39:24.000000000 +0100
@@ -6,7 +6,6 @@
 import time
 from typing import TYPE_CHECKING, Any, Awaitable, Optional, cast, TypeVar
 
-from anyio import Lock
 from azure.core.credentials import AccessToken
 from azure.core.pipeline import PipelineRequest, PipelineResponse
 from azure.core.pipeline.policies import AsyncHTTPPolicy
@@ -15,6 +14,7 @@
 )
 from azure.core.pipeline.transport import AsyncHttpResponse as 
LegacyAsyncHttpResponse, HttpRequest as LegacyHttpRequest
 from azure.core.rest import AsyncHttpResponse, HttpRequest
+from azure.core.utils._utils import get_running_async_lock
 
 from .._tools_async import await_result
 
@@ -38,11 +38,17 @@
     def __init__(self, credential: "AsyncTokenCredential", *scopes: str, 
**kwargs: Any) -> None:
         super().__init__()
         self._credential = credential
-        self._lock = Lock()
         self._scopes = scopes
+        self._lock_instance = None
         self._token: Optional["AccessToken"] = None
         self._enable_cae: bool = kwargs.get("enable_cae", False)
 
+    @property
+    def _lock(self):
+        if self._lock_instance is None:
+            self._lock_instance = get_running_async_lock()
+        return self._lock_instance
+
     async def on_request(self, request: PipelineRequest[HTTPRequestType]) -> 
None:
         """Adds a bearer token Authorization header to request and sends 
request to next policy.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-core-1.29.6/azure/core/utils/_utils.py 
new/azure-core-1.29.7/azure/core/utils/_utils.py
--- old/azure-core-1.29.6/azure/core/utils/_utils.py    2023-12-13 
21:06:44.000000000 +0100
+++ new/azure-core-1.29.7/azure/core/utils/_utils.py    2024-01-18 
16:39:24.000000000 +0100
@@ -5,8 +5,10 @@
 # license information.
 # --------------------------------------------------------------------------
 import datetime
+import sys
 from typing import (
     Any,
+    AsyncContextManager,
     Iterable,
     Iterator,
     Mapping,
@@ -161,3 +163,26 @@
 
     def __repr__(self) -> str:
         return str(dict(self.items()))
+
+
+def get_running_async_lock() -> AsyncContextManager:
+    """Get a lock instance from the async library that the current context is 
running under.
+
+    :return: An instance of the running async library's Lock class.
+    :rtype: AsyncContextManager
+    :raises: RuntimeError if the current context is not running under an async 
library.
+    """
+
+    try:
+        import asyncio
+
+        # Check if we are running in an asyncio event loop.
+        asyncio.get_running_loop()
+        return asyncio.Lock()
+    except RuntimeError as err:
+        # Otherwise, assume we are running in a trio event loop if it has 
already been imported.
+        if "trio" in sys.modules:
+            import trio  # pylint: 
disable=networking-import-outside-azure-core-transport
+
+            return trio.Lock()
+        raise RuntimeError("An asyncio or trio event loop is required.") from 
err
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-core-1.29.6/azure_core.egg-info/PKG-INFO 
new/azure-core-1.29.7/azure_core.egg-info/PKG-INFO
--- old/azure-core-1.29.6/azure_core.egg-info/PKG-INFO  2023-12-13 
21:07:27.000000000 +0100
+++ new/azure-core-1.29.7/azure_core.egg-info/PKG-INFO  2024-01-18 
16:40:05.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: azure-core
-Version: 1.29.6
+Version: 1.29.7
 Summary: Microsoft Azure Core Library for Python
 Home-page: 
https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/core/azure-core
 Author: Microsoft Corporation
@@ -20,7 +20,6 @@
 Requires-Python: >=3.7
 Description-Content-Type: text/markdown
 License-File: LICENSE
-Requires-Dist: anyio<5.0,>=3.0
 Requires-Dist: requests>=2.21.0
 Requires-Dist: six>=1.11.0
 Requires-Dist: typing-extensions>=4.6.0
@@ -192,7 +191,6 @@
 | logging_enable| Use to enable per operation. Defaults to `False`. |
 | logger | If specified, it will be used to log information. |
 | response_encoding | The encoding to use if known for this service (will 
disable auto-detection). |
-| proxies | Maps protocol or protocol and hostname to the URL of the proxy. |
 | raw_request_hook | Callback function. Will be invoked on request. |
 | raw_response_hook | Callback function. Will be invoked on response. |
 | network_span_namer | A callable to customize the span name. |
@@ -288,6 +286,12 @@
 
 # Release History
 
+## 1.29.7 (2024-01-18)
+
+### Other Changes
+
+- Removed dependency on `anyio`.  #33282
+
 ## 1.29.6 (2023-12-14)
 
 ### Bugs Fixed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-core-1.29.6/azure_core.egg-info/requires.txt 
new/azure-core-1.29.7/azure_core.egg-info/requires.txt
--- old/azure-core-1.29.6/azure_core.egg-info/requires.txt      2023-12-13 
21:07:27.000000000 +0100
+++ new/azure-core-1.29.7/azure_core.egg-info/requires.txt      2024-01-18 
16:40:05.000000000 +0100
@@ -1,4 +1,3 @@
-anyio<5.0,>=3.0
 requests>=2.21.0
 six>=1.11.0
 typing-extensions>=4.6.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-core-1.29.6/samples/example_shared_transport.py 
new/azure-core-1.29.7/samples/example_shared_transport.py
--- old/azure-core-1.29.6/samples/example_shared_transport.py   2023-12-13 
21:06:44.000000000 +0100
+++ new/azure-core-1.29.7/samples/example_shared_transport.py   2024-01-18 
16:39:24.000000000 +0100
@@ -28,22 +28,25 @@
 
 def shared_transport():
     # [START shared_transport]
-    shared_transport = RequestsTransport()
+    import requests
+
+    session = requests.Session()
+    shared_transport = RequestsTransport(
+        session=session, session_owner=False
+    )  # here we set session_owner to False to indicate that we don't want to 
close the session when the client is closed
     with shared_transport:
         blob_service_client1 = BlobServiceClient.from_connection_string(
             connection_string,
             transport=shared_transport,
-            session_owner=False,  # here we set session_owner to False to 
indicate that we don't want to close the session when the client is closed
-        )
-        blob_service_client2 = BlobServiceClient.from_connection_string(
-            connection_string, transport=shared_transport, session_owner=False
         )
+        blob_service_client2 = 
BlobServiceClient.from_connection_string(connection_string, 
transport=shared_transport)
         containers1 = blob_service_client1.list_containers()
         for contain in containers1:
             print(contain.name)
         containers2 = blob_service_client2.list_containers()
         for contain in containers2:
             print(contain.name)
+    session.close()  # we need to close the session manually
     # [END shared_transport]
 
 
@@ -55,20 +58,17 @@
     adapter = requests.adapters.HTTPAdapter(pool_connections=100, 
pool_maxsize=100)
     session.mount("http://";, adapter)
     session.mount("https://";, adapter)
-    shared_transport = RequestsTransport(session=session)
+    shared_transport = RequestsTransport(session=session, session_owner=False)
     with shared_transport:
-        blob_service_client1 = BlobServiceClient.from_connection_string(
-            connection_string, transport=shared_transport, session_owner=False
-        )
-        blob_service_client2 = BlobServiceClient.from_connection_string(
-            connection_string, transport=shared_transport, session_owner=False
-        )
+        blob_service_client1 = 
BlobServiceClient.from_connection_string(connection_string, 
transport=shared_transport)
+        blob_service_client2 = 
BlobServiceClient.from_connection_string(connection_string, 
transport=shared_transport)
         containers1 = blob_service_client1.list_containers()
         for contain in containers1:
             print(contain.name)
         containers2 = blob_service_client2.list_containers()
         for contain in containers2:
             print(contain.name)
+    session.close()  # we need to close the session manually
     # [END shared_transport_with_pooling]
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-core-1.29.6/samples/example_shared_transport_async.py 
new/azure-core-1.29.7/samples/example_shared_transport_async.py
--- old/azure-core-1.29.6/samples/example_shared_transport_async.py     
2023-12-13 21:06:44.000000000 +0100
+++ new/azure-core-1.29.7/samples/example_shared_transport_async.py     
2024-01-18 16:39:24.000000000 +0100
@@ -29,22 +29,25 @@
 
 async def shared_transport_async():
     # [START shared_transport_async]
-    shared_transport = AioHttpTransport()
+    import aiohttp
+
+    session = aiohttp.ClientSession()
+    shared_transport = AioHttpTransport(
+        session=session, session_owner=False
+    )  # here we set session_owner to False to indicate that we don't want to 
close the session when the client is closed
     async with shared_transport:
         blob_service_client1 = BlobServiceClient.from_connection_string(
             connection_string,
             transport=shared_transport,
-            session_owner=False,  # here we set session_owner to False to 
indicate that we don't want to close the session when the client is closed
-        )
-        blob_service_client2 = BlobServiceClient.from_connection_string(
-            connection_string, transport=shared_transport, session_owner=False
         )
+        blob_service_client2 = 
BlobServiceClient.from_connection_string(connection_string, 
transport=shared_transport)
         containers1 = blob_service_client1.list_containers()
         async for contain in containers1:
             print(contain.name)
         containers2 = blob_service_client2.list_containers()
         async for contain in containers2:
             print(contain.name)
+    await session.close()  # we need to close the session manually
     # [END shared_transport_async]
 
 
@@ -54,20 +57,17 @@
 
     conn = aiohttp.TCPConnector(limit=100)
     session = aiohttp.ClientSession(connector=conn)
-    shared_transport = AioHttpTransport(session=session)
+    shared_transport = AioHttpTransport(session=session, session_owner=False)
     async with shared_transport:
-        blob_service_client1 = BlobServiceClient.from_connection_string(
-            connection_string, transport=shared_transport, session_owner=False
-        )
-        blob_service_client2 = BlobServiceClient.from_connection_string(
-            connection_string, transport=shared_transport, session_owner=False
-        )
+        blob_service_client1 = 
BlobServiceClient.from_connection_string(connection_string, 
transport=shared_transport)
+        blob_service_client2 = 
BlobServiceClient.from_connection_string(connection_string, 
transport=shared_transport)
         containers1 = blob_service_client1.list_containers()
         async for contain in containers1:
             print(contain.name)
         containers2 = blob_service_client2.list_containers()
         async for contain in containers2:
             print(contain.name)
+    await session.close()  # we need to close the session manually
     # [END shared_transport_async_with_pooling]
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-core-1.29.6/setup.py 
new/azure-core-1.29.7/setup.py
--- old/azure-core-1.29.6/setup.py      2023-12-13 21:06:44.000000000 +0100
+++ new/azure-core-1.29.7/setup.py      2024-01-18 16:39:24.000000000 +0100
@@ -69,7 +69,6 @@
     },
     python_requires=">=3.7",
     install_requires=[
-        "anyio>=3.0,<5.0",
         "requests>=2.21.0",
         "six>=1.11.0",
         "typing-extensions>=4.6.0",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-core-1.29.6/tests/async_tests/test_authentication_async.py 
new/azure-core-1.29.7/tests/async_tests/test_authentication_async.py
--- old/azure-core-1.29.6/tests/async_tests/test_authentication_async.py        
2023-12-13 21:06:44.000000000 +0100
+++ new/azure-core-1.29.7/tests/async_tests/test_authentication_async.py        
2024-01-18 16:39:24.000000000 +0100
@@ -4,8 +4,9 @@
 # license information.
 # -------------------------------------------------------------------------
 import asyncio
+import sys
 import time
-from unittest.mock import Mock
+from unittest.mock import Mock, patch
 from requests import Response
 
 from azure.core.credentials import AccessToken
@@ -20,11 +21,12 @@
 )
 from azure.core.pipeline.transport import AsyncHttpTransport, HttpRequest
 import pytest
+import trio
 
-pytestmark = pytest.mark.asyncio
 from utils import HTTP_REQUESTS
 
 
[email protected]
 @pytest.mark.parametrize("http_request", HTTP_REQUESTS)
 async def test_bearer_policy_adds_header(http_request):
     """The bearer token policy should add a header containing a token from its 
credential"""
@@ -54,6 +56,7 @@
     assert get_token_calls == 1
 
 
[email protected]
 @pytest.mark.parametrize("http_request", HTTP_REQUESTS)
 async def test_bearer_policy_send(http_request):
     """The bearer token policy should invoke the next policy's send method and 
return the result"""
@@ -72,6 +75,7 @@
     assert response is expected_response
 
 
[email protected]
 @pytest.mark.parametrize("http_request", HTTP_REQUESTS)
 async def test_bearer_policy_sync_send(http_request):
     """The bearer token policy should invoke the next policy's send method and 
return the result"""
@@ -90,6 +94,7 @@
     assert response is expected_response
 
 
[email protected]
 @pytest.mark.parametrize("http_request", HTTP_REQUESTS)
 async def test_bearer_policy_token_caching(http_request):
     good_for_one_hour = AccessToken("token", time.time() + 3600)
@@ -130,6 +135,7 @@
     assert get_token_calls == 2  # token expired -> policy should call 
get_token
 
 
[email protected]
 @pytest.mark.parametrize("http_request", HTTP_REQUESTS)
 async def test_bearer_policy_optionally_enforces_https(http_request):
     """HTTPS enforcement should be controlled by a keyword argument, and 
enabled by default"""
@@ -158,6 +164,7 @@
     await pipeline.run(http_request("GET", "https://secure";))
 
 
[email protected]
 @pytest.mark.parametrize("http_request", HTTP_REQUESTS)
 async def test_bearer_policy_preserves_enforce_https_opt_out(http_request):
     """The policy should use request context to preserve an opt out from https 
enforcement"""
@@ -175,6 +182,7 @@
     await pipeline.run(http_request("GET", "http://not.secure";), 
enforce_https=False)
 
 
[email protected]
 @pytest.mark.parametrize("http_request", HTTP_REQUESTS)
 async def test_bearer_policy_context_unmodified_by_default(http_request):
     """When no options for the policy accompany a request, the policy 
shouldn't add anything to the request context"""
@@ -192,6 +200,7 @@
     await pipeline.run(http_request("GET", "https://secure";))
 
 
[email protected]
 @pytest.mark.parametrize("http_request", HTTP_REQUESTS)
 async def test_bearer_policy_calls_sansio_methods(http_request):
     """AsyncBearerTokenCredentialPolicy should call SansIOHttpPolicy methods 
as does _SansIOAsyncHTTPPolicyRunner"""
@@ -440,3 +449,24 @@
 
     cred = TestTokenCredential()
     await cred.get_token("scope")
+
+
[email protected]
+async def test_async_token_credential_asyncio_lock():
+    auth_policy = AsyncBearerTokenCredentialPolicy(Mock(), "scope")
+    assert isinstance(auth_policy._lock, asyncio.Lock)
+
+
[email protected]
+async def test_async_token_credential_trio_lock():
+    auth_policy = AsyncBearerTokenCredentialPolicy(Mock(), "scope")
+    assert isinstance(auth_policy._lock, trio.Lock)
+
+
+def test_async_token_credential_sync():
+    """Verify that AsyncBearerTokenCredentialPolicy can be constructed in a 
synchronous context."""
+    auth_policy = AsyncBearerTokenCredentialPolicy(Mock(), "scope")
+    with patch.dict("sys.modules"):
+        # Ensure trio isn't in sys.modules (i.e. imported).
+        sys.modules.pop("trio", None)
+        AsyncBearerTokenCredentialPolicy(Mock(), "scope")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-core-1.29.6/tests/test_utils.py 
new/azure-core-1.29.7/tests/test_utils.py
--- old/azure-core-1.29.6/tests/test_utils.py   2023-12-13 21:06:44.000000000 
+0100
+++ new/azure-core-1.29.7/tests/test_utils.py   2024-01-18 16:39:24.000000000 
+0100
@@ -2,8 +2,12 @@
 # Copyright (c) Microsoft Corporation.
 # Licensed under the MIT License.
 # ------------------------------------
+import sys
+from unittest.mock import patch
+
 import pytest
 from azure.core.utils import case_insensitive_dict
+from azure.core.utils._utils import get_running_async_lock
 
 
 @pytest.fixture()
@@ -108,3 +112,25 @@
 
     for key in my_dict:
         assert key in keys
+
+
[email protected]
+async def test_get_running_async_module_asyncio():
+    import asyncio
+
+    assert isinstance(get_running_async_lock(), asyncio.Lock)
+
+
[email protected]
+async def test_get_running_async_module_trio():
+    import trio
+
+    assert isinstance(get_running_async_lock(), trio.Lock)
+
+
+def test_get_running_async_module_sync():
+    with patch.dict("sys.modules"):
+        # Ensure trio isn't in sys.modules (i.e. imported).
+        sys.modules.pop("trio", None)
+        with pytest.raises(RuntimeError):
+            get_running_async_lock()

Reply via email to