I'm running across this too now. I think part of the problem is that pybuild
invokes unittest discover by default, but this isn't how paramiko's test suite
is actually run, at least if you go by what's in the tox.ini file.
This gets me closer:
diff --git a/debian/rules b/debian/rules
index 9c04662..8d5d25b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,6 +1,7 @@
#!/usr/bin/make -f
export PYBUILD_NAME=paramiko
+export PYBUILD_TEST_ARGS={interpreter} $(CURDIR)/test.py
%:
dh $@ --with python2,python3 --buildsystem=pybuild
@@ -11,3 +12,5 @@ ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
endif
dh_installdocs
+override_dh_auto_test:
+ PYBUILD_SYSTEM=custom dh_auto_test
But I'm still seeing two failures and two errors:
======================================================================
ERROR: test_K_utf8 (tests.test_sftp.SFTPTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/<<PKGBUILDDIR>>/tests/test_sftp.py", line 171, in tearDown
sftp.rmdir(FOLDER)
File "/<<PKGBUILDDIR>>/paramiko/sftp_client.py", line 390, in rmdir
self._request(CMD_RMDIR, path)
File "/<<PKGBUILDDIR>>/paramiko/sftp_client.py", line 729, in _request
return self._read_response(num)
File "/<<PKGBUILDDIR>>/paramiko/sftp_client.py", line 776, in _read_response
self._convert_status(msg)
File "/<<PKGBUILDDIR>>/paramiko/sftp_client.py", line 806, in _convert_status
raise IOError(text)
IOError: Failure
======================================================================
ERROR: test_L_utf8_chdir (tests.test_sftp.SFTPTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/<<PKGBUILDDIR>>/tests/test_sftp.py", line 679, in test_L_utf8_chdir
sftp.mkdir(FOLDER + '/' + unicode_folder)
File "/<<PKGBUILDDIR>>/paramiko/sftp_client.py", line 380, in mkdir
self._request(CMD_MKDIR, path, attr)
File "/<<PKGBUILDDIR>>/paramiko/sftp_client.py", line 729, in _request
return self._read_response(num)
File "/<<PKGBUILDDIR>>/paramiko/sftp_client.py", line 776, in _read_response
self._convert_status(msg)
File "/<<PKGBUILDDIR>>/paramiko/sftp_client.py", line 806, in _convert_status
raise IOError(text)
IOError: Failure
======================================================================
FAIL: test_K_utf8 (tests.test_sftp.SFTPTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/<<PKGBUILDDIR>>/tests/test_sftp.py", line 675, in test_K_utf8
self.fail('exception ' + str(e))
AssertionError: exception Failure
======================================================================
FAIL: test_O_getcwd (tests.test_sftp.SFTPTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/<<PKGBUILDDIR>>/tests/test_sftp.py", line 734, in test_O_getcwd
self.assertEqual(None, sftp.getcwd())
AssertionError: None != u'/'
----------------------------------------------------------------------
Ran 148 tests in 34.596s
FAILED (failures=2, errors=2)