[Tutor] Mocking with "mock" in unit testing

Steven D'Aprano steve at pearwood.info
Fri Jan 17 16:32:34 CET 2014


On Fri, Jan 17, 2014 at 08:35:04AM -0500, eryksun wrote:
> On Fri, Jan 17, 2014 at 6:23 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> > On Fri, Jan 17, 2014 at 09:58:06AM +0000, James Chapman wrote:
[...]
> >> import mockimport unittestimport pinger
> >>  class Test_Pinger(unittest.TestCase):
> >
> > And here you have two more SyntaxErrors: missing commas between
> > arguments to import, and a stray space before the "class" again.
> 
> This is also fine in the rich text version. BTW, the botched plain
> text conversion is missing line breaks, not commas.

I don't understand this. If I'm interpreting you correctly,


import mockimport 
unittestimport 
pinger


would not be "fine".


-- 
Steven


More information about the Tutor mailing list