sftp transport module requires testtools

Bug #516183 reported by Martin von Gagern
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Critical
Vincent Ladeuil

Bug Description

Pushing over sftp requires testtools to be installed. That shouldn't be the case. Backtrace attached. Also look at http://bazaar.launchpad.net/~bzr-pqm/bzr/bzr.dev/revision/1530.1.3/bzrlib/transport/sftp.py which introduced this import.

Related branches

Revision history for this message
Martin von Gagern (gagern) wrote :
Revision history for this message
Martin Pool (mbp) wrote :

Ouch, that kind of sucks. Thanks for the report. It's because the sftp transport includes its testing server implementation, which is a bit dirty in the first place.

Changed in bzr:
importance: Undecided → High
status: New → Confirmed
tags: added: easy sftp testtools transport
Revision history for this message
Martin Pool (mbp) wrote :

The way I would suggest handling this is by moving the server into a separate module that depends on testtools but that does not need to be loaded in normal use.

  File ".../bzr.dev/bzrlib/transport/__init__.py", line 1589, in get_transport
    transport, last_err = _try_transport_factories(base, factory_list)
  File ".../bzr.dev/bzrlib/transport/__init__.py", line 1612, in _try_transport_factories
    return factory.get_obj()(base), None
  File ".../bzr.dev/bzrlib/registry.py", line 61, in get_obj
    self._do_import()
  File ".../bzr.dev/bzrlib/registry.py", line 70, in _do_import
    obj = __import__(self._module_name, globals(), locals(), names)
  File ".../bzr.dev/bzrlib/transport/sftp.py", line 890, in <module>
    from bzrlib.tests.stub_sftp import StubServer, StubSFTPServer
  File ".../bzr.dev/bzrlib/tests/__init__.py", line 53, in <module>
    import testtools
ImportError: No module named testtools

Vincent Ladeuil (vila)
Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
status: Confirmed → In Progress
Revision history for this message
Vincent Ladeuil (vila) wrote :

Given that testtools is not in the Ubuntu packages dependencies and I seem to
recall windows excluding tests from the installer packaging,
I've bumped the severity to critical and will propose a merge against 2.1.

Changed in bzr:
importance: High → Critical
tags: removed: easy
Changed in bzr:
milestone: none → 2.1.0
Vincent Ladeuil (vila)
Changed in bzr:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.