Skip to content

prefer newer unittest.mock from standard library #108

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

a-detiste
Copy link

Hi,

The good new is that VAPID enterred today in Debian.

The bad news is that we are trying to get rid of old Python 2.7-3.4 era mock backport.

Please consider this patch

@jrconlin
Copy link
Member

Argh.
I really need to audit these and get them up-to-date, don't I?

Thanks! I'll push a new version tomorrow (Mar 31)

@jrconlin
Copy link
Member

I'll also redo your patch so it's signed.

@a-detiste
Copy link
Author

I really need to audit these and get them up-to-date, don't I?

To do that, one would first need to define the minimumu suported Python version.

Then from unittest.mock import patch, Mock might be enough

jrconlin added a commit that referenced this pull request Apr 1, 2025
@a-detiste
Copy link
Author

This use of annotations in the codebase means you requires at least Pyrhon3.7 or more.

from unittest.mock import patch should always be enough. The try/catch block is not necessary

@jrconlin
Copy link
Member

jrconlin commented Apr 1, 2025

Ah! Thanks! I'll bump the minimum version and remove the try.

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