[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2019-04-04 Thread Jason R. Coombs
Jason R. Coombs added the comment: Confirmed the fix. Thank you very much! -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2019-02-25 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Closing this as resolved. @jaraco this just made it to 3.8.0 alpha 2, feel free to reopen this if needed. Thanks Mario and Chris for review and merge :) -- ___ Python tracker

[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2019-02-25 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2019-02-25 Thread Chris Withers
Chris Withers added the comment: New changeset ea199b90bb61866cd3c2f154341d1eb0d5c4a710 by Chris Withers (Miss Islington (bot)) in branch '3.7': bpo-35512: Resolve string target to patch.dict decorator during function call GHGH-12000 (#12021)

[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2019-02-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +12053 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2019-02-24 Thread Chris Withers
Chris Withers added the comment: New changeset a875ea58b29fbf510f9790ae1653eeaa47dc0de8 by Chris Withers (Xtreak) in branch 'master': bpo-35512: Resolve string target to patch.dict decorator during function call GH#12000

[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2019-02-23 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- keywords: +patch pull_requests: +12030 stage: -> patch review ___ Python tracker ___ ___

[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2019-02-23 Thread Mario Corchero
Mario Corchero added the comment: Great, all yours :) I'll be happy to review. -- ___ Python tracker ___ ___ Python-bugs-list

[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2019-02-23 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks Mario for the details. I had almost the same patch while writing msg336300 :) There were no test case failures except that I had resolved it in the constructor storing the string representation as a separate variable and also while calling

[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2019-02-23 Thread Mario Corchero
Mario Corchero added the comment: Interesting, `patch` does resolve it when the patched function is called (see https://github.com/python/cpython/blob/175421b58cc97a2555e474f479f30a6c5d2250b0/Lib/unittest/mock.py#L1269) vs patch.dict that resolves it at the time the patcher is created - when

[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2019-02-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Looking further this can be solved for a string target in patch.dict which can be resolved again while calling the decorated function. There could be a case where the actual target is specified and in that case mock could only updates the

[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2019-02-22 Thread Jason R. Coombs
Jason R. Coombs added the comment: I agree that’s a good reproducer. Thanks for looking into this! -- ___ Python tracker ___ ___

[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2019-02-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: If I understand the issue correctly it's as below is a simple reproducer where target is resolved with {'a': 1} during the construction of the decorator [0] though it's redefined later in the program as target = dict(a=2). Also here due to this

[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2018-12-16 Thread Jason R. Coombs
New submission from Jason R. Coombs : Originally [reported in testing-cabal/mock#405](https://github.com/testing-cabal/mock/issues/405), I believe I've discovered an inconsistency that manifests as a flaw: `patch` and `patch.object` allow the target to be specified as string referring to