[Twisted-Python] twisted.trial : running tests : example requested

Itamar Shtull-Trauring itamar at itamarst.org
Thu Oct 6 09:18:11 EDT 2005


On Thu, 2005-10-06 at 09:41 +1100, Jonathan Lange wrote:
> On 06/10/05, Jp Calderone <exarkun at divmod.com> wrote:
> > On Wed, 05 Oct 2005 13:47:21 -0700, Todd Greenwood <tgreenwoodgeer at yahoo.com> wrote:
> > >1. I saw an email thread that stated that the twisted.trial.doctest feature
> > >is going away, is this true? If not, could I get a simple example?
> >
> > Hopefully.  It's embarassing.
> >
> 
> It's not going away (yet).  It will be in 2.1.
> You can find an example of its use in twisted/web2/test/test_stream.py
> (in svn).

Running that gives me some passing tests, but also:
IMPORT ERROR:

Could not import twisted.web2.stream:
  File "/home/itamarst/devel/python/Twisted/twisted/trial/runner.py",
line 710, in loadDoctests
    return super(SafeTestLoader, self).loadDoctests(module)
  File "/home/itamarst/devel/python/Twisted/twisted/trial/runner.py",
line 672, in loadDoctests
    return DocTestSuite(module)
  File "/home/itamarst/devel/python/Twisted/twisted/trial/runner.py",
line 102, in __init__
    suite = doctest.DocTestSuite(testModule)
  File "/home/itamarst/devel/python/Twisted/twisted/trial/doctest.py",
line 2239, in DocTestSuite
    return self._dt_test.name
exceptions.AttributeError: 'module' object has no attribute 'TestSuite'






More information about the Twisted-Python mailing list