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

refactor: keep the unittest.mock names in the 'mock' namespace #1379

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

tonyandrewmeyer
Copy link
Contributor

No functional changes (including to the tests) - this just adjusts the imports so that the names from unittest.mock are imported into a mock namespace, rather than all into the module namespace.

Primarily, this ensures that typing.Any and unittest.mock.ANY are clearly distinguished by more than case, but it's also generally tidier ("Namespaces are one honking great idea").

See discussion in #1373.

Copy link
Contributor

@james-garner-canonical james-garner-canonical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@tonyandrewmeyer tonyandrewmeyer merged commit 84ad4b0 into canonical:main Sep 18, 2024
29 checks passed
@tonyandrewmeyer tonyandrewmeyer deleted the any-vs-ANY branch September 18, 2024 03:39
tonyandrewmeyer added a commit to tonyandrewmeyer/operator that referenced this pull request Oct 4, 2024
…ical#1379)

No functional changes (including to the tests) - this just adjusts the
imports so that the names from `unittest.mock` are imported into a
`mock` namespace, rather than all into the module namespace.

Primarily, this ensures that `typing.Any` and `unittest.mock.ANY` are
clearly distinguished by more than case, but it's also generally tidier
("Namespaces are one honking great idea").

See discussion in canonical#1373.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants