Skip to content
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

Merged
merged 15 commits into from
Aug 16, 2021

Conversation

chlowell
Copy link
Member

@chlowell chlowell commented Jul 9, 2021

Closes #18798

@ghost ghost added the Azure.Identity label Jul 9, 2021
@pytest.mark.parametrize("environ", ALL_ENVIRONMENTS)
def test_close(environ):
transport = mock.MagicMock()
with mock.patch.dict("os.environ", environ, clear=True):
Copy link
Member

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?

Copy link
Member Author

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]>
@chlowell chlowell merged commit f16b965 into Azure:main Aug 16, 2021
@chlowell chlowell deleted the context-managers branch August 16, 2021 15:50
iscai-msft added a commit to iscai-msft/azure-sdk-for-python that referenced this pull request Aug 23, 2021
…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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable opening and closing synchronous credential transports
2 participants