[issue41403] Uncaught AttributeError in unittest.mock._get_target

Chris Withers report at bugs.python.org
Mon Jul 27 02:40:04 EDT 2020


Chris Withers <chris at withers.org> 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 for this?

I'd be fine to see this bug closed with "wontfix", but will leave it open for now in case others feel strongly differently.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41403>
_______________________________________


More information about the Python-bugs-list mailing list