[New-bugs-announce] [issue38669] patch.object should raise another error when first argument is a str

Elena Oat report at bugs.python.org
Sat Nov 2 22:30:39 EDT 2019


New submission from Elena Oat <oat.elena at gmail.com>:

When using patch.object with first argument as a string, e.g. 
´´patch.object('SomeClass', 'somemethod')´´ this raises ´´AttributeError: Something does not have the attribute 'do_something'´´. 
This should instead warn user that the correct type for the first argument is a class.

----------
components: Tests
messages: 355886
nosy: Elena.Oat
priority: normal
severity: normal
status: open
title: patch.object should raise another error when first argument is a str
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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


More information about the New-bugs-announce mailing list