Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

tests: Fix import pattern for mock objects #89

Merged
merged 1 commit into from
Oct 28, 2021
Merged

Conversation

smcv
Copy link
Contributor

@smcv smcv commented Oct 28, 2021

The legacy mock module contains a mock.mock submodule, but unittest.mock
does not contain a redundant unittest.mock.mock. This bug was masked by
the transparent fallback to the legacy mock module.

The actual test only uses mock.patch(), so we can simplify by just
importing the one member that we need.

Fixes: a1ca117 "tests: Use unittest.mock from Python standard library if possible"

The legacy mock module contains a mock.mock submodule, but unittest.mock
does not contain a redundant unittest.mock.mock. This bug was masked by
the transparent fallback to the legacy mock module.

The actual test only uses mock.patch(), so we can simplify by just
importing the one member that we need.

Fixes: a1ca117 "tests: Use unittest.mock from Python standard library if possible"
Signed-off-by: Simon McVittie <smcv@debian.org>
@smcv smcv merged commit ff499bb into intel:master Oct 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants