Edgewall Software

Opened 9 years ago

Closed 7 years ago

#11642 closed enhancement (fixed)

Test failures with Twill 1.8.0

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 0.12.8
Component: general Version:
Severity: normal Keywords: twill functional tests
Cc: Branch:
Release Notes:

Enforce Twill required version of 0.9 or 0.9.1.

API Changes:
Internal Changes:


As mentioned on the mailing list (gdiscussion:trac-dev:sCRapSYsEGQ). After installing the dependencies of Twill 1.8.0: requests lxml and cssselect (pull request #6 is needed to improve handling of the package dependencies), the first error encountered is:

$ python ./trac/tests/functional/__init__.py
Traceback (most recent call last):
  File "./trac/tests/functional/__init__.py", line 221, in <module>
  File "/usr/lib/python2.7/unittest/main.py", line 95, in __init__
  File "/usr/lib/python2.7/unittest/main.py", line 232, in runTests
    self.result = testRunner.run(self.test)
  File "/usr/lib/python2.7/unittest/runner.py", line 151, in run
  File "/usr/lib/python2.7/unittest/suite.py", line 70, in __call__
    return self.run(*args, **kwds)
  File "/usr/lib/python2.7/unittest/suite.py", line 108, in run
  File "/usr/lib/python2.7/unittest/suite.py", line 70, in __call__
    return self.run(*args, **kwds)
  File "/home/user/Workspace/newtwill/teo-rjollos.git/trac/test.py", line 137, in run
  File "./trac/tests/functional/__init__.py", line 151, in setUp
  File "/home/user/Workspace/newtwill/teo-rjollos.git/trac/tests/functional/testenv.py", line 271, in start
  File "/home/user/Workspace/newtwill/py2.7/local/lib/python2.7/site-packages/twill-1.8.0-py2.7.egg/twill/commands.py", line 109, in go
  File "/home/user/Workspace/newtwill/py2.7/local/lib/python2.7/site-packages/twill-1.8.0-py2.7.egg/twill/browser.py", line 91, in go
    raise TwillException("cannot go to '%s'" % (url,))
twill.errors.TwillException: cannot go to ''

Package versions are:

>>> import twill
>>> twill.__version__
>>> twill.__path__
>>> import requests
>>> requests.__version__
>>> import lxml
>>> lxml.etree.LXML_VERSION
(3, 3, 5, 0)
>>> import cssselect
>>> cssselect.__version__

The version is in the Twill package on PyPI is incorrect. The version has been fixed in the codebase.

Attachments (0)

Change History (3)

comment:1 by Ryan J Ollos, 7 years ago

Milestone: undecided1.2
Owner: set to Ryan J Ollos
Status: newassigned

We could just require version 0.9 and focus on #11988. I found that twill.__version__ is 0.9 even when 0.9.1 is installed.

  • trac/tests/functional/__init__.py

    diff --git a/trac/tests/functional/__init__.py b/trac/tests/functional/__init__.py
    index a4668ff..9cd53c8 100755
    a b import sys  
    6464import time
    6565import unittest
    6666from datetime import datetime, timedelta
     67from pkg_resources import parse_version
    6869import trac
    6970from trac.tests.compat import rmtree
    if twill:  
    113114        tester_class = FunctionalTester
     116        def __init__(self):
     117            if parse_version(twill.__version__) != parse_version('0.9'):
     118                raise ImportError("Twill 0.9 is required. Found version %s."
     119                                  % twill.__version__)
     120            super(FunctionalTestSuite, self).__init__()
    115122        def setUp(self, port=None):
    116123            """If no port is specified, use a semi-random port and subdirectory
    117124            'testenv'; but if a port is specified, use that port and

comment:2 by Christian Boos, 7 years ago

Yes, I think we should not invest more time on Twill, I doubt 1.8 or later version will add JavaScript support for example.

I did some experiments with Selenium, and I was very favorably impressed, I think it will be possible at some point to simply switch our functional tests over to use selenium. Of course, it'll be quite some work (#11988), but I rather see the effort spent there rather than on supporting a newer Twill version.

comment:3 by Ryan J Ollos, 7 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

I'm looking forward to selenium. While I might be getting better at regex writing due to Twill, overall I'd say it's not very productive for functional tests.

Changes committed to 0.12-stable in [14792], merged to 1.0-stable in [14793], merged to trunk in [14794].

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.