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

Consistently use unittest.mock in tests #3638

Merged
merged 1 commit into from Oct 21, 2022
Merged

Consistently use unittest.mock in tests #3638

merged 1 commit into from Oct 21, 2022

Conversation

hroncok
Copy link
Contributor

@hroncok hroncok commented Oct 17, 2022

Summary of changes

Consistently use unittest.mock in tests

  • Some tests used unittest.mock from the standard library
  • Some tests used mock from PyPI
  • Some tests tried to import unittest.mock with a fallback to mock (the import never fails on Python 3.7+, older Pythons are not supported)

Pull Request Checklist

 - Some tests used unittest.mock from the standard library
 - Some tests used mock from PyPI
 - Some tests tried to import unittest.mock with a fallback to mock
   (the import never fails on Python 3.7+, older Pythons are not supported)
Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

Personally, I'd prefer relying on the pytest's built-in monkeypatch fixture and the pytest-mock package. But I think this is already a great first step towards consistency.

@jaraco jaraco merged commit 484fedb into pypa:main Oct 21, 2022
@hroncok hroncok deleted the mock branch October 21, 2022 09:17
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.

None yet

3 participants