-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add context manager API to azure.identity credentials #19746
Conversation
sdk/identity/azure-identity/azure/identity/aio/_credentials/app_service.py
Outdated
Show resolved
Hide resolved
d8cb5fe
to
28d7d0c
Compare
Co-authored-by: McCoy Patiño <[email protected]>
ec8370b
to
a572786
Compare
sdk/identity/azure-identity/azure/identity/aio/_credentials/azure_arc.py
Outdated
Show resolved
Hide resolved
@pytest.mark.parametrize("environ", ALL_ENVIRONMENTS) | ||
def test_close(environ): | ||
transport = mock.MagicMock() | ||
with mock.patch.dict("os.environ", environ, clear=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you want to patch {Credential}.__module__ + ".os.environ"
across the board, or just in async EnvironmentCredential tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to use more narrow patches everywhere. It doesn't work here because the inner credentials need to observe the same environment variables. Since broad patches don't impact our tests as currently run, I prefer using one here over baking more knowledge of the implementation into this test or testing the inner credentials separately.
Co-authored-by: McCoy Patiño <[email protected]>
…into have_pipelines_support_rest * 'main' of https://github.com/Azure/azure-sdk-for-python: (108 commits) Enable API review approval check for Java spring packages (Azure#20311) [AutoRelease] t2-iothubprovisioningservices-2021-07-15-81882 (Azure#19816) Increment package version after release of azure-eventgrid (Azure#20204) Sync eng/common directory with azure-sdk-tools for PR 1909 (Azure#20298) Rename attrs is metrics (Azure#20236) [EventHubs] checkpointstoretable - skip tests until env vars configured (Azure#20289) Update to use timespan (Azure#20233) Prevent wildcard expansion in git sparse checkout add (Azure#20267) Fix typo and polish the key concepts (Azure#18407) Fix IOT Device Update readme issue (Azure#18752) Add context manager API to azure.identity credentials (Azure#19746) Add support for 'files' configuration (Azure#20272) Update main for 30-close.py (Azure#20287) [AutoRelease] t2-purview-2021-08-13-30358 (Azure#20260) add implementation for checkpointstoretable (Azure#19905) Fix resource clean-up script (Azure#20273) [Tables] Fix bug in update mode (Azure#20264) Add Rest Method checks to Prepare-Release (Azure#20275) Update release date (Azure#20270) Update the release date for ACS chat 1.1.0b1 (Azure#20277) ...
Closes #18798