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

Drop PyPI mock test dependency #2190

Merged
merged 1 commit into from
Jan 14, 2022

Conversation

musicinmybrain
Copy link
Contributor

The functionality is in the standard library as unittest.mock beginning with Python 3.3.

Issue #, if available: (none)

Description of changes:

In any tests, prefer to import from unittest.mock in the Python 3.3+ standard library, falling back to the PyPI mock backport package only where required (Python 2.7). Drop the mock dependency from tox.ini for Python 3.3+, too.

See https://fedoraproject.org/wiki/Changes/DeprecatePythonMock for further context.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kddejong
Copy link
Contributor

kddejong commented Jan 7, 2022

I want to just drop python 2 support at this point. Thanks for submitting this PR.

@musicinmybrain
Copy link
Contributor Author

I want to just drop python 2 support at this point. Thanks for submitting this PR.

You’re welcome. Are you ready to drop Python 2 support immediately? I can easily add a commit to this PR that removes the workarounds for Python 2, if that is helpful.

@kddejong
Copy link
Contributor

Should be covered in #2195

@kddejong
Copy link
Contributor

Just merged in the python 2.7 EOL changes

@musicinmybrain
Copy link
Contributor Author

musicinmybrain commented Jan 13, 2022

It looks like #2195 did not remove the PyPI mock dependency. Now that it’s merged, though, I can rebase this PR on main and remove the mock dependency unconditionally.

The functionality is in the standard library as unittest.mock
beginning with Python 3.3.

Since aws-cloudformation#2195 removed
support for everything below Python 3.6, the dependency can be removed
unconditionally.
@musicinmybrain
Copy link
Contributor Author

The dependency removal is now unconditional, which makes for a much cleaner PR.

@musicinmybrain musicinmybrain changed the title Drop PyPI mock test dependency on Python 3 Drop PyPI mock test dependency Jan 13, 2022
@kddejong kddejong merged commit dcf1e78 into aws-cloudformation:main Jan 14, 2022
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this pull request Jan 20, 2022
python-mock is no longer necessary after
aws-cloudformation/cfn-lint#2190


git-svn-id: file:///srv/repos/svn-community/svn@1111241 9fca08f4-af9d-4005-b8df-a31f2cc04f65
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this pull request Jan 20, 2022
python-mock is no longer necessary after
aws-cloudformation/cfn-lint#2190

git-svn-id: file:///srv/repos/svn-community/svn@1111241 9fca08f4-af9d-4005-b8df-a31f2cc04f65
kddejong pushed a commit to kddejong/cfn-python-lint that referenced this pull request Feb 28, 2022
The functionality is in the standard library as unittest.mock
beginning with Python 3.3.

Since aws-cloudformation#2195 removed
support for everything below Python 3.6, the dependency can be removed
unconditionally.
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.

2 participants