[Tutor] Newbie & Unittest ...

Vincent Davis vincent at vincentdavis.net
Thu May 6 21:52:13 CEST 2010


On Thu, May 6, 2010 at 1:15 PM, Steve Willoughby <steve at alchemy.com> wrote:

> The unit test methods all take message arguments so if you just
> want to customize the reported error, that's easily done.
>
> something like:
>  self.assertEqual(self.file.tags[k], v, "Failure with key "+k)
>
> That's easiest.  If you really want a separate test for each, you
> may want to create a factory function which will generate the individual
> test methods when the testcase object is created.
>
> --steve


Looks like Steve answered the question you had for me,
 "self.assertEqual(self.file.tags[k], v, "Failure with key "+k)" I think
this is the best(how I would do it) solution, 1 test for files with a
meaningful report as to which file is the problem.

  *Vincent Davis
720-301-3003 *
vincent at vincentdavis.net
 my blog <http://vincentdavis.net> |
LinkedIn<http://www.linkedin.com/in/vincentdavis>

On Thu, May 6, 2010 at 1:15 PM, Steve Willoughby <steve at alchemy.com> wrote:

> The unit test methods all take message arguments so if you just
> want to customize the reported error, that's easily done.
>
> something like:
>  self.assertEqual(self.file.tags[k], v, "Failure with key "+k)
>
> That's easiest.  If you really want a separate test for each, you
> may want to create a factory function which will generate the individual
> test methods when the testcase object is created.
>
> --steve
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100506/61716d34/attachment.html>


More information about the Tutor mailing list