Pārlūkot izejas kodu

Try to fix fail on travis.io

oz123 10 gadi atpakaļ
vecāks
revīzija
a1a2792d03
1 mainītis faili ar 10 papildinājumiem un 2 dzēšanām
  1. 10 2
      pwman/tests/test_complete_ui.py

+ 10 - 2
pwman/tests/test_complete_ui.py

@@ -44,10 +44,18 @@ class Ferrum(unittest.TestCase):
 
     def test_a_db_warning(self):
         "when trying to run with old db, we should see warning"
+        lfile = 'convert-test.log'
+        logfile = open(lfile, 'w')
         child = pexpect.spawn(os.path.join(os.path.dirname(__file__),
                                            '../../scripts/pwman3') +
-                              ' -d '+OLD_DB_PATH)
-        self.assertEqual(0, child.expect(_db_warn, timeout=0.5))
+                              ' -d '+OLD_DB_PATH, logfile=lfile)
+
+        rv = child.expect(_db_warn, timeout=5)
+        if rv != 0:
+            lfile.seek(0)
+            print lfile.readlines()
+
+        self.assertEqual(0, rv)
 
     def test_b_run_convert(self):
         "invoke pwman with -k option to convert the old data"