[issue41403] Uncaught AttributeError in unittest.mock._get_target

2022-01-23 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue41403] Uncaught AttributeError in unittest.mock._get_target

2022-01-23 Thread Irit Katriel
Irit Katriel added the comment: New changeset 1398dca838529e682c06b496cc1911d91334ff3a by Irit Katriel in branch '3.9': bpo-41403: Improve error message for invalid mock target (GH-30833) (GH-30835) https://github.com/python/cpython/commit/1398dca838529e682c06b496cc1911d91334ff3a

[issue41403] Uncaught AttributeError in unittest.mock._get_target

2022-01-23 Thread Irit Katriel
Irit Katriel added the comment: New changeset e3ade66ec575e0cb4882cfdff155ef962e67c837 by Irit Katriel in branch '3.10': bpo-41403: Improve error message for invalid mock target (GH-30833) (GH-30834) https://github.com/python/cpython/commit/e3ade66ec575e0cb4882cfdff155ef962e67c837

[issue41403] Uncaught AttributeError in unittest.mock._get_target

2022-01-23 Thread Irit Katriel
Change by Irit Katriel : -- pull_requests: +29021 pull_request: https://github.com/python/cpython/pull/30835 ___ Python tracker ___

[issue41403] Uncaught AttributeError in unittest.mock._get_target

2022-01-23 Thread Irit Katriel
Change by Irit Katriel : -- pull_requests: +29020 pull_request: https://github.com/python/cpython/pull/30834 ___ Python tracker ___

[issue41403] Uncaught AttributeError in unittest.mock._get_target

2022-01-23 Thread Irit Katriel
Irit Katriel added the comment: New changeset f7955a82e36d4c32ebdd7b7707cdf0e6ffa7a418 by Irit Katriel in branch 'main': bpo-41403: Improve error message for invalid mock target (GH-30833) https://github.com/python/cpython/commit/f7955a82e36d4c32ebdd7b7707cdf0e6ffa7a418 --

[issue41403] Uncaught AttributeError in unittest.mock._get_target

2022-01-23 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +patch nosy: +iritkatriel nosy_count: 6.0 -> 7.0 pull_requests: +29019 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30833 ___ Python tracker

[issue41403] Uncaught AttributeError in unittest.mock._get_target

2022-01-14 Thread Irit Katriel
Change by Irit Katriel : -- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7 ___ Python tracker ___ ___ Python-bugs-list

[issue41403] Uncaught AttributeError in unittest.mock._get_target

2022-01-01 Thread Andrei Kulakov
Andrei Kulakov added the comment: More generally, split()/rsplit() are probably the most common operations done on expected string at the start of a function, i.e. most likely to be triggered on the wrong type passed in. At the same time to many new users split()/rsplit() does not imply

[issue41403] Uncaught AttributeError in unittest.mock._get_target

2020-07-27 Thread Chris Withers
Chris Withers added the comment: Given that `mock.patch` is being used incorrectly here, the error message seems clear enough: It's saying there's a `Foo` object in place, and `rsplit` gives a strong indication that a string was expected. Would adding type hints in mock.py be a resolution

[issue41403] Uncaught AttributeError in unittest.mock._get_target

2020-07-26 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +cjw296, mariocj89, michael.foord, xtreak ___ Python tracker ___ ___ Python-bugs-list

[issue41403] Uncaught AttributeError in unittest.mock._get_target

2020-07-26 Thread webisteme
New submission from webisteme : When calling `mock.patch` incorrectly, as in the following example, an uncaught error is thrown: ```shell >>> from unittest import mock >>> class Foo: ... pass ... >>> mock.patch(Foo()) Traceback (most recent call last): File "", line 1, in File