Opened 4 years ago

Last modified 4 years ago

#6363 enhancement new

Make twisted.trial.unittest._iterateTests public.

Reported by: Tom Prince Owned by: Tom Prince
Priority: normal Milestone:
Component: trial Keywords:
Cc: Jonathan Lange Branch: branches/public-iterateTests-6363
branch-diff, diff-cov, branch-cov, buildbot
Author: tomprince

Description

#3231 is removing support for visiting tests suites. But there isn't any good replacement for it. We have _iterateTests which provides the same functionality, which is used throughout trial. We should provide it to users, as a replacement for visitors. (See 6333#comment:5 for some rationale).

Change History (6)

comment:1 Changed 4 years ago by DefaultCC Plugin

Cc: Jonathan Lange added

comment:2 Changed 4 years ago by Tom Prince

Author: tomprince
Branch: branches/public-iterateTests-6363

(In [37469]) Branching to public-iterateTests-6363.

comment:3 Changed 4 years ago by Tom Prince

Keywords: review added
Owner: Tom Prince deleted

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

Keywords: review removed
Owner: set to Tom Prince

But there isn't any good replacement for it.

Why should it be replaced? Who is using this functionality outside of the implementation of trial? What is it useful for?

This widens the interface of trial in an area where we're not really the bosses. Who says it's actually possible to iterate over all the tests in a TestSuite? Before accepting this new public API, we should consider whether it will have interoperability issues with other unittest users and other xUnit tools, and we should consider whether it's worth adding at all without real world use cases.

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

I also added a response to 6333#comment:5 at 6333#comment:6.

comment:6 Changed 4 years ago by Tom Prince

Hmm. I'm almost tempted to move this to python instead, since the implementation doesn't actually care what it is iterating.

Note: See TracTickets for help on using tickets.