Re: Test-Driven Dev. (Kent Beck) Python Chapter Question

Discussion in 'Python' started by Peter Hansen, Jun 26, 2003.

  1. Peter Hansen

    Peter Hansen Guest

    "yaipa h." wrote:
    >
    > In Chapter 20. Cleaning Up After
    >
    > When adding "tearDown()" to "TestCase" in xUnit, the TestCase method run()
    > suddenly takes on a new argument named "result." In the next line result
    > is used as "result.testStarted()." Oddly, when TestCase.run() is called by
    > "TestCaseTest" it is called without an argument, so of course Python complains.
    > If I drop "result" from the argument list and strike the line
    > "result.testStarted()" everything works fine. I've looked and
    > there seems to be no code download page or errata available.
    >
    > Anyone had similar problems with this chapter or am I reading over
    > something here?


    I think you're right. I looked ahead at page 114 and found what I
    think is the first place where run() actually takes a TestResult
    object, in a later chapter.

    It looks like this was an early mistake, as it appears even in the first
    draft of the book which had this chapter, from March 9 last year.
    (See http://groups.yahoo.com/group/testdrivendevelopment/files/ for ref.)

    Yaipa, if you submit this errata report on the testdrivendevelopment
    group on Yahoo Groups it would probably be appreciated.

    -Peter
     
    Peter Hansen, Jun 26, 2003
    #1
    1. Advertising

  2. Peter Hansen

    John Roth Guest

    "Peter Hansen" <> wrote in message
    news:...
    > "yaipa h." wrote:
    > >
    > > In Chapter 20. Cleaning Up After
    > >
    > > When adding "tearDown()" to "TestCase" in xUnit, the TestCase method

    run()
    > > suddenly takes on a new argument named "result." In the next line

    result
    > > is used as "result.testStarted()." Oddly, when TestCase.run() is

    called by
    > > "TestCaseTest" it is called without an argument, so of course Python

    complains.
    > > If I drop "result" from the argument list and strike the line
    > > "result.testStarted()" everything works fine. I've looked and
    > > there seems to be no code download page or errata available.
    > >
    > > Anyone had similar problems with this chapter or am I reading over
    > > something here?

    >
    > I think you're right. I looked ahead at page 114 and found what I
    > think is the first place where run() actually takes a TestResult
    > object, in a later chapter.
    >
    > It looks like this was an early mistake, as it appears even in the

    first
    > draft of the book which had this chapter, from March 9 last year.
    > (See http://groups.yahoo.com/group/testdrivendevelopment/files/ for

    ref.)

    I agree, it looks like a misprint. There's nothing in the narrative in
    Chapter
    20 to justify putting in the collecting parameter, while there's a
    discussion in
    Chapter 23, including all the changes to the various calls that resulted
    from
    adding the parameter.

    > Yaipa, if you submit this errata report on the testdrivendevelopment
    > group on Yahoo Groups it would probably be appreciated.
    >
    > -Peter


    John Roth
     
    John Roth, Jun 26, 2003
    #2
    1. Advertising

  3. Peter Hansen

    yaipa h. Guest

    Steven, Peter, John,

    Thanks, yes now I see run() looses it's argument in ch21 and
    doesn't get it back until page 3 of chapter 23.

    I believe that I have found one other error in ch19, so I think that
    I will go a head and finish out xUnit fully and collect all the bits and
    pieces into a single errata once I am done. I'll make sure to cross post
    as suggested.

    Thanks for all the help, there for a while I thought I had really
    slipped off the deep end. One does not expect such things when studying
    xUnit methods.

    Even with a couple of gotchas, I still believe that the book is of great
    value to anyone trying to understand Unit Testing.

    --Alan



    "John Roth" <> wrote in message news:<>...
    > "Peter Hansen" <> wrote in message
    > news:...
    > > "yaipa h." wrote:
    > > >
    > > > In Chapter 20. Cleaning Up After
    > > >
    > > > When adding "tearDown()" to "TestCase" in xUnit, the TestCase method

    > run()
    > > > suddenly takes on a new argument named "result." In the next line

    > result
    > > > is used as "result.testStarted()." Oddly, when TestCase.run() is

    > called by
    > > > "TestCaseTest" it is called without an argument, so of course Python

    > complains.
    > > > If I drop "result" from the argument list and strike the line
    > > > "result.testStarted()" everything works fine. I've looked and
    > > > there seems to be no code download page or errata available.
    > > >
    > > > Anyone had similar problems with this chapter or am I reading over
    > > > something here?

    > >
    > > I think you're right. I looked ahead at page 114 and found what I
    > > think is the first place where run() actually takes a TestResult
    > > object, in a later chapter.
    > >
    > > It looks like this was an early mistake, as it appears even in the

    > first
    > > draft of the book which had this chapter, from March 9 last year.
    > > (See http://groups.yahoo.com/group/testdrivendevelopment/files/ for

    > ref.)
    >
    > I agree, it looks like a misprint. There's nothing in the narrative in
    > Chapter
    > 20 to justify putting in the collecting parameter, while there's a
    > discussion in
    > Chapter 23, including all the changes to the various calls that resulted
    > from
    > adding the parameter.
    >
    > > Yaipa, if you submit this errata report on the testdrivendevelopment
    > > group on Yahoo Groups it would probably be appreciated.
    > >
    > > -Peter

    >
    > John Roth
     
    yaipa h., Jun 27, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yan-Hong Huang[MSFT]
    Replies:
    0
    Views:
    435
    Yan-Hong Huang[MSFT]
    Oct 15, 2003
  2. Nick Zdunic
    Replies:
    0
    Views:
    949
    Nick Zdunic
    Nov 5, 2003
  3. Daniel Dyer
    Replies:
    0
    Views:
    403
    Daniel Dyer
    Jan 5, 2006
  4. Daniel Dyer
    Replies:
    0
    Views:
    352
    Daniel Dyer
    Apr 3, 2006
  5. Manfred Schwab
    Replies:
    5
    Views:
    1,291
    Chris Liechti
    Nov 6, 2004
Loading...

Share This Page