[issue11468] Improve unittest basic example in the doc

2015-03-24 Thread Ezio Melotti
Ezio Melotti added the comment: I tweaked the wording a bit, added a link to the section about setUp/tearDown, and applied it on all the 3 branches. Thanks for the patch Florian! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___

[issue11468] Improve unittest basic example in the doc

2015-03-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4a2a5fddbab3 by Ezio Melotti in branch '2.7': #11468: improve unittest basic example. Initial patch by Florian Preinstorfer. https://hg.python.org/cpython/rev/4a2a5fddbab3 New changeset 010e33b37feb by Ezio Melotti in branch '3.4': #11468: improve

[issue11468] Improve unittest basic example in the doc

2015-03-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: Yes, go ahead an apply this patch. -- assignee: rhettinger -> ezio.melotti ___ Python tracker ___ ___

[issue11468] Improve unittest basic example in the doc

2015-03-18 Thread Ezio Melotti
Ezio Melotti added the comment: Raymond, in the meanwhile can the proposed patch be applied? I don't think it's necessary to show that you need to import a module in order to test its functions. Using modules also has the disadvantage that people might not know what result to expect if they ar

[issue11468] Improve unittest basic example in the doc

2014-05-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, I'm going to test some other module (math or somesuch) rather than the built-in string methods. The normal use of unittest is to import both the unittest module and the module under test. I want to show that pattern (which is somewhat different from

[issue11468] Improve unittest basic example in the doc

2014-05-27 Thread Zachary Ware
Changes by Zachary Ware : -- nosy: +zach.ware ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue11468] Improve unittest basic example in the doc

2014-05-27 Thread Berker Peksag
Changes by Berker Peksag : -- versions: +Python 3.5 -Python 3.3 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11468] Improve unittest basic example in the doc

2013-05-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: -serhiy.storchaka stage: commit review -> patch review versions: +Python 3.4 -Python 3.2 ___ Python tracker ___ __

[issue11468] Improve unittest basic example in the doc

2012-12-24 Thread Ezio Melotti
Ezio Melotti added the comment: Given that this is a basic example, it's not necessary to introduce both the forms of assertRaises. I personally find the context manager form more readable, and I prefer it to the regular one even if it takes two lines instead of one. -- __

[issue11468] Improve unittest basic example in the doc

2012-12-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think `self.assertRaises(TypeError, s.split, 2)` looks simpler. In any case two examples for assertRaises needed, simple inlined and more complicated use as context manager. -- nosy: +serhiy.storchaka ___ Python

[issue11468] Improve unittest basic example in the doc

2012-10-26 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: -berker.peksag ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue11468] Improve unittest basic example in the doc

2011-12-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Ezio, please leave this one for me. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue11468] Improve unittest basic example in the doc

2011-12-12 Thread Ezio Melotti
Ezio Melotti added the comment: The patch includes only assertEqual, assertTrue, and assertRaises and, except a s/functions/methods/ in the first line, looks good to me. -- stage: needs patch -> commit review versions: -Python 3.1 ___ Python tracke

[issue11468] Improve unittest basic example in the doc

2011-12-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'll be updating this example shortly, but it is intentional that it include only assertEqual, assertTrue, and assertRaises. Those three are the minimum necessary to get up and running (which is the whole point of the BASIC example). -- assignee:

[issue11468] Improve unittest basic example in the doc

2011-12-12 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berkerpeksag ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue11468] Improve unittest basic example in the doc

2011-07-18 Thread Éric Araujo
Éric Araujo added the comment: I think there’s value in accepting the current patch as really basic example, and then see if the section about setting up and tearing down also has a very simple example. -- ___ Python tracker

[issue11468] Improve unittest basic example in the doc

2011-07-17 Thread Senthil Kumaran
Senthil Kumaran added the comment: I would be +1 if the basic example also highlights setUp and tearDown methods. Those are useful ones for a new comer to know via an example snippet and not just with explanation. -- nosy: +orsenthil ___ Python tra

[issue11468] Improve unittest basic example in the doc

2011-07-05 Thread Florian Preinstorfer
Florian Preinstorfer added the comment: I tried to implement the improvements suggested by Ezio Melotti and updated the documentation accordingly. -- keywords: +patch nosy: +notizblock Added file: http://bugs.python.org/file22576/issue-11468.patch _

[issue11468] Improve unittest basic example in the doc

2011-03-12 Thread Éric Araujo
Éric Araujo added the comment: LGTM. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org

[issue11468] Improve unittest basic example in the doc

2011-03-11 Thread Ezio Melotti
New submission from Ezio Melotti : The current example[0] uses assertTrue(element in self.seq) but it would be better to use assertIn instead. The whole example could be changed to something simpler that uses only the assertTrue/assertEqual/assertRaises methods correctly, e.g.: import unitte