New submission from Michael Foord: A common problem with unittest.mock.Mock is to mistype an assert method. Because mocks create attributes on demand your test will pass without error.
We should raise an AttributeError if you access any attribute name (that doesn't exist) starting with assert or assret. There should also be a keyword argument allowing you to get the old behaviour if you need it (but this new feature should be on by default). Will also need docs. ---------- assignee: michael.foord components: Library (Lib) messages: 216320 nosy: kushal.das, michael.foord priority: normal severity: normal stage: needs patch status: open title: unittest.mock.Mock should not allow you to use non-existent assert methods type: behavior versions: Python 3.5 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21238> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com