[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Changes by Robert Collins robe...@robertcollins.net: -- stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Roundup Robot added the comment: New changeset 738de9a9a3ea by Robert Collins in branch '3.5': Issue #20362: Honour TestCase.longMessage correctly in assertRegex. https://hg.python.org/cpython/rev/738de9a9a3ea New changeset 977e60f597de by Robert Collins in branch 'default': Issue #20362: Honour TestCase.longMessage correctly in assertRegex. https://hg.python.org/cpython/rev/977e60f597de -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Robert Collins added the comment: Thanks for the patch, applied to 3.5 and 3.6. -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Ilia Kurenkov added the comment: Bump :) Let's close this one, guys! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Ilia Kurenkov added the comment: Thanks for the feedback, folks. Adding the updated patch. -- Added file: http://bugs.python.org/file40115/20362_py35.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Berker Peksag added the comment: Sorry for my late response, Ilia. Your reply to my first question looks correct to me. Please send your updated patch and I'll apply. -- assignee: - berker.peksag versions: +Python 3.4, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Arnon Yaari added the comment: * The removal of the 'kot' test is ok. That's what the fix is about. With longMessage set to False, we should only see the custom message, 'Message', and not the message about the regex that contains 'kot'. * Please update the patch for 3.5 to use assertRegex and assertNotRegex in the assertMessages call. These are the new names. With the current patch, the tests throw deprecation warnings. Other than that the patch looks good (I am not a committer, though, so I can't help further). -- versions: -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Ilia Kurenkov added the comment: I notice folks have been subscribing to this. Any chance we could review it and merge? :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Changes by Torsten Bronger bron...@physik.rwth-aachen.de: -- nosy: +bronger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Changes by Arnon Yaari wiggi...@gmail.com: -- nosy: +wiggin15 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Changes by Ned Deily n...@acm.org: -- nosy: +rbcollins ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Ilia Kurenkov added the comment: Hi there! I was wondering if anyone had a chance to take a look at this :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Ilia Kurenkov added the comment: Hi Berker! I hope all's well on your end. Let me know if you have questions about the reasoning behind my changes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Berker Peksag added the comment: Thanks for the patches, Ilia. The one for 2.7 looks good. Reviewing 20362_py35.patch: * Looks almost identical to issue20362.diff except style changes and the two comments below, right? * -self.assertIn('kot', e.args[0]) Why did you remove this line? * +assertNotRegexpMatches = _deprecate(assertNotRegex) This looks like an unrelated change, but I think it can be committed. Thanks for the catch! * The tests should be updated to use assertRegex and assertNotRegex -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Ilia Kurenkov added the comment: Modified to work with 3.5. Attaching patch file. -- Added file: http://bugs.python.org/file38960/20362_py35.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Ilia Kurenkov added the comment: This fix has been retested with 2.7, I'm uploading the relevant patch files. -- nosy: +copper-head Added file: http://bugs.python.org/file38958/20362_py27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Ilia Kurenkov added the comment: Thanks for the quick response, Berker! Let me address your comments in the order you made them. #1: removing checking for kot in the exception args. This line was causing the tests to fail, which is how I noticed it. The reason it fails (I think) is caused by the changes made in the patch. Namely, the fact that we're strictly sticking to longMessage=False means the custom message passed by the user (in this particular case that's Message) is be the *only* thing sent to AssertionError. Thus checking for the presence of kot in this error's args doesn't seem to make much sense and will simply keep breaking our tests. Now it goes without saying that I may have missed something, please let me know if that's the case. #2 For some reason I got the impression that the tests should be using the newer method names, but since using the old ones didn't break them on my machine, I've updated the patch file accordingly. I'll upload it pending your feedback regarding #1. Glad to help! Ilia. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Berker Peksag added the comment: I've added missing self._formatMessage() functions to assertRegex and assertNotRegex asserts. -- keywords: +patch nosy: +berker.peksag stage: needs patch - patch review versions: -Python 3.3 Added file: http://bugs.python.org/file35274/issue20362.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
New submission from Dhara: Various assert methods added in version 2.7 ignore the longMessage attribute: http://docs.python.org/2.7/library/unittest.html#unittest.TestCase.longMessage For example when matching regular expressions using unittest.TestCase.assertRegexpMatches, the following error is generated: AssertionError: custom short message: 'regexp' not found in 'text' Since longMessage is ignored, and the text to be matched can be pages long, the error messages are impossibly long. [See also: http://stackoverflow.com/questions/21157905/suppress-supplementary-error-message-from-unit-test] -- components: Library (Lib) messages: 208899 nosy: Dhara priority: normal severity: normal status: open title: longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20362] longMessage attribute is ignored in unittest.TestCase.assertRegexpMatches etc
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +ezio.melotti, michael.foord ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20362 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com