Opened 4 years ago

Closed 4 years ago

#6315 enhancement closed fixed (fixed)

twisted/words/test/test_service.py uses `deferredGenerator`

Reported by: Tom Prince Owned by: Tom Prince
Priority: normal Milestone:
Component: words Keywords:
Cc: ralphm Branch: branches/de-defgen-twisted.words-6315
branch-diff, diff-cov, branch-cov, buildbot
Author: tomprince

Description

#6044 wants to deprecate deferredGenerator, but it is used extensively in t.w.test.test_service. It actually appears that (since the tests are using the synchronous InMemoryWordsRealm, that the tests could instead use successResultOf and failureResultOf instead.

Change History (5)

comment:1 Changed 4 years ago by DefaultCC Plugin

Cc: ralphm added

comment:2 Changed 4 years ago by Tom Prince

Author: tomprince
Branch: branches/de-defgen-twisted.words-6315

(In [37192]) Branching to de-defgen-twisted.words-6315.

comment:3 Changed 4 years ago by Tom Prince

Keywords: review added
Owner: set to ralphm

comment:4 Changed 4 years ago by Richard Wall

Keywords: review removed
Owner: changed from ralphm to Tom Prince

Here's a quick, inexpert, review of the changes:

  • I inspected all the changes and the updated tests all appear to be equivalent to the original tests.
  • It's nice that the new tests are so much more succinct.
  • All those new tests pass for me (Fedora 18)
  • I compared coverage of words.service in trunk against this branch and it appears to be exactly the same...which is reassuring.
--- /tmp/coverage_report_de-defgen.log  2013-03-09 23:45:47.034799667 +0000
+++ /tmp/coverage_report_trunk.log      2013-03-09 23:42:55.055202673 +0000
...
Name                                                                                           Stmts   Miss Branch BrMiss  Cover
--------------------------------------------------------------------------------------------------------------------------------
...
 twisted/words/ewords                                                                              15      1      0      0    93%
 twisted/words/iwords                                                                              40      0     44     22    74%
 twisted/words/protocols/__init__                                                                   0      0      0      0   100%
-twisted/words/protocols/irc                                                                     1280    758    364    315    35%
+twisted/words/protocols/irc                                                                     1279    758    364    315    35%
 twisted/words/service                                                                            601    101    118     33    81%
 twisted/words/test/__init__                                                                        0      0      0      0   100%
-twisted/words/test/test_service                                                                  523     12     34      4    97%
+twisted/words/test/test_service                                                                  682     12     34      4    98%

I noticed one issue:

  1. One new build error
    1. There's a new line length warning
      ************* Module twisted.words.test.test_service
      C0301:106,0: Line too long (85/79)
      

You may prefer ralphm to have a look at the branch too, but it looks good to me.

Fix that long line and merge as far as I'm concerned.

-RichardW.

comment:5 Changed 4 years ago by Tom Prince

Resolution: fixed
Status: newclosed

(In [37583]) Merge de-defgen-twisted.words-6315: Use inlineCallbacks in twisted.words.test.test_service.

Author: tom.prince Reviewers: rwall Fixes: #6315

We want to deprecate deferredGenerator, so remove the uses of it here.

Note: See TracTickets for help on using tickets.