Opened 10 years ago

Closed 9 years ago

#2894 enhancement closed fixed (fixed)

twisted.test.test_defer.DeferredTestCase.testMaybeDeferred should be faster and four different tests

Reported by: Jean-Paul Calderone Owned by:
Priority: highest Milestone:
Component: core Keywords:
Cc: therve Branch: branches/test-maybedeferred-2894
branch-diff, diff-cov, branch-cov, buildbot
Author: therve

Description

testMaybeDeferred uses reactor.callLater(0.2 twice, making it take at least 0.4 seconds to run. This could easily be shortened so that it succeeds synchronously (it's trying to test the uncalled Deferred case for success and error, but it could do this by calling back the Deferred after maybeDeferred has gotten a hold of it).

It's also testing four different conditions, so it should be broken into separate test methods.

Change History (7)

comment:1 Changed 9 years ago by therve

author: therve
Branch: branches/test-maybedeferred-2894

(In [22091]) Branching to 'test-maybedeferred-2894'

comment:2 Changed 9 years ago by therve

(In [22092]) Fix testMaybeDeferred: split it in 4, add some docstrings.

Refs #2894

comment:3 Changed 9 years ago by therve

Cc: therve added
Keywords: review added
Owner: Glyph deleted
Priority: normalhighest

This is ready to review.

comment:4 Changed 9 years ago by Jean-Paul Calderone

Owner: set to Jean-Paul Calderone
Status: newassigned

comment:5 Changed 9 years ago by Jean-Paul Calderone

Keywords: review removed
Owner: changed from Jean-Paul Calderone to therve
Status: assignednew

Looks good

comment:6 Changed 9 years ago by therve

Resolution: fixed
Status: newclosed

(In [22179]) Merge test-maybedeferred-2894

Author: therve Reviewer: exarkun Fixes #2894

Split the tests of maybeDeferred into 4 smaller tests, and remove the callLater from the tests.

comment:7 Changed 6 years ago by <automation>

Owner: therve deleted
Note: See TracTickets for help on using tickets.