Changes between and of Initial VersionVersion 3Ticket #6834


Ignore:
Timestamp:
11/17/2013 05:32:51 AM (7 years ago)
Author:
Jean-Paul Calderone
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6834

    • Property Cc Jonathan Lange Tristan Seligmann added
  • Ticket #6834 – Description

    initial v3  
    44
    55{{{
    6 10:27 < jonathanj> is there a reason that SynchronousTestCase doesn't fail if you return a Deferred from a test method?
    7 10:34 < lvh> jonathanj: My guess is backwards compat? Althoguh I guess that's why we have SynchronousTestCase in the first place
    8 10:35 < lvh> jonathanj: Can't find any tickets. Sounds like a bug to me (although maybe it's too late to change the behavior)
    9 10:35 < jonathanj> it would be kind of convenient if returning a Deferred from a SynchronousTestCase method actually failed the test instead of silently passing it regardless of the result
    10 10:35 < lvh> then again I'm pretty sure returning a Deferred from a SynchronousTestCase should always fail :)
    11 10:39 < jml> I thought the point of a synchronoustestcase was a deferred-returning test case that doesn't use the reactor.
     610:27 < jonathanj> is there a reason that SynchronousTestCase doesn't fail if you
     7          return a Deferred from a test method?
     810:34 < lvh> jonathanj: My guess is backwards compat? Althoguh I guess that's why
     9          we have SynchronousTestCase in the first place
     1010:35 < lvh> jonathanj: Can't find any tickets. Sounds like a bug to me (although
     11          maybe it's too late to change the behavior)
     1210:35 < jonathanj> it would be kind of convenient if returning a Deferred from a
     13          SynchronousTestCase method actually failed the test instead of silently
     14          passing it regardless of the result
     1510:35 < lvh> then again I'm pretty sure returning a Deferred from a
     16          SynchronousTestCase should always fail :)
     1710:39 < jml> I thought the point of a synchronoustestcase was a deferred-returning
     18          test case that doesn't use the reactor.
    121910:39 < jml> but icbw
    132010:41 < lvh> jml: Part of the point was to decouple the reactor at least
    14 10:41 < lvh> but if you're not using the reactor who will fire those deferreds you're returning
     2110:41 < lvh> but if you're not using the reactor who will fire those deferreds
     22          you're returning
    152310:41 < lvh> (and what's the point of self.successResultOf/self.failureResultOf)
    162410:41 < lifeless> the postactor
    17 10:41 < jonathanj> jml: well the source code for _runTestsAndFixturesBlahBlah disregards the result of runWithWarningsSuppressed entirely
     2510:41 < jonathanj> jml: well the source code for _runTestsAndFixturesBlahBlah
     26          disregards the result of runWithWarningsSuppressed entirely
    182710:41 < jonathanj> jml: so i don't think that's it
    192810:41 < lvh> lifeless: the what
    202910:41 < jonathanj> sorry, just _run
    21 10:42 < idnar> lvh: the point of successResultOf/failureResultOf is to avoid returning a Deferred from the test
     3010:42 < idnar> lvh: the point of successResultOf/failureResultOf is to avoid
     31          returning a Deferred from the test
    223210:42 < lifeless> lvh: I'm very sorry, but - YHBT, HAND, HTH.
    23 10:42 < lvh> idnar: so does that mean returning a deferred from the test method is always wrong
     3310:42 < lvh> idnar: so does that mean returning a deferred from the test method is
     34          always wrong
    243510:42 < idnar> lvh: or having the reactor involved at all
    253610:42 < jonathanj> YHBT?
     
    314210:43 < lvh> idnar: that's what it looks like to me
    324310:43 < lvh> idnar: given what I thought sRO and fRO were for
    33 10:43 < idnar> lvh: ie. you should always use SynchronousTestCase instead of TestCase, at least when writing a unit test
     4410:43 < idnar> lvh: ie. you should always use SynchronousTestCase instead of TestCase,
     45          at least when writing a unit test
    344610:43 < lvh> and what the entire point was of SynchronousTestCase
    35 10:43 < idnar> (people also use trial to write things that are not unit tests, though, so...)
     4710:43 < idnar> (people also use trial to write things that are not unit tests, though,
     48          so...)
    3649}}}