wolever / parameterized

Parameterized testing with any Python test framework
Other
836 stars 105 forks source link

Make `parameterized.expand` play nice with underlying `mock` patches #129

Closed alexpizarroj closed 1 year ago

alexpizarroj commented 3 years ago

Fixes issue #66.

This is a workaround for https://bugs.python.org/issue40126 when using parameterized.expand along old mock versions.

Avoid fully stripping out patches from source methods and replace them with a "dummy" no-op patch instead.

alexpizarroj commented 3 years ago

Greetings, @wolever

I've put together a PR that fixes the long-standing issue #66. I'd love to get some feedback on it / hear your thoughts. 😃

Also, is there a way for me to trigger CI tests for my PR? Nevermind, just managed to run them and they all passed 🎆 : https://app.circleci.com/pipelines/github/alexpizarroj/parameterized/2/workflows/eb15ed9c-5118-443e-a33d-ad70414aa6d9

Thanks in advance.

alexpizarroj commented 3 years ago

Just realized that you may have already implemented something very similar to this workaround, @wolever . I'm talking about https://github.com/wolever/parameterized/commit/737c1e8e8749d5f0a3bdcb247b476d2f24b215ef. The "hack" in the commit is very similar to mine, though you also introduced changes to the reapplication of patches. Was there any reason to not pursue this further?

wandering-tales commented 3 years ago

:+1:

alexpizarroj commented 3 years ago

@wolever Please take a look when you can, or perhaps point me to someone else maintaining this project who can help push this forward... It's been a couple of months since I posted and I'd hate for this to get stale again 🙏🏻

apizarro-paypal commented 2 years ago

@wolever Would appreciate some eyes on this, please. It's already been several months 🙏🏻

abacigalup-eb commented 2 years ago

bump, +1

wolever commented 1 year ago

Ah! Thank you very much for the time you've put into this, and I'm extremely sorry it took so long to get merged.

It's in there now, and will be released as part of 0.9.0.

Thank you again!

wolever commented 1 year ago

Hey folks! Just a heads up: 0.9.0 is out: https://pypi.org/project/parameterized/0.9.0/