← Back to team overview

duplicity-team team mailing list archive

[Merge] lp:~aaron-whitehouse/duplicity/fix_2to3_issues into lp:duplicity

 

Aaron Whitehouse has proposed merging lp:~aaron-whitehouse/duplicity/fix_2to3_issues into lp:duplicity.

Requested reviews:
  duplicity-team (duplicity-team)

For more details, see:
https://code.launchpad.net/~aaron-whitehouse/duplicity/fix_2to3_issues/+merge/266649

Fixed 2to3 issues. Updated README-REPO with more test information. Updated pylint and test_diff2 descriptions to make it clear these require packages to be installed on the system to pass. All tests pass on Python 2.6 and Python 2.7 as at this revision.
-- 
Your team duplicity-team is requested to review the proposed merge of lp:~aaron-whitehouse/duplicity/fix_2to3_issues into lp:duplicity.
=== modified file 'README-REPO'
--- README-REPO	2015-07-31 14:49:46 +0000
+++ README-REPO	2015-08-01 12:09:10 +0000
@@ -31,11 +31,9 @@
 Running the unit tests:
 -----------------------
 
+To run all tests:
 cd testing; ./run-tests
 
-Please run the tests on your branch before proposing a merge, to ensure that
-you have not broken any tests that previously worked.
-
 You can run specific tests using:
 tox -- -s [folder].[folder].[file].[class].[test]
 For example:
@@ -43,6 +41,28 @@
 or:
 tox -- -s testing.unit.test_selection.MatchingTest.test_tuple_include
 
+Note: some tests require rdiff and pylint to be installed on the system for
+them to pass.
+
+Please run all tests on your branch (run-tests) before proposing a merge, to
+ensure that all tests pass. The decorator @unittest.expectedFailure can be used
+to commit a known-failing test case without breaking the test suite, for
+example to exhibit the behaviour in a bug report before it has been fixed:
+
+if sys.version_info < (2, 7):
+    import unittest2 as unittest
+else:
+    import unittest
+
+
+class TestClass(unittest.TestCase):
+    """Test class to show expectedFailure"""
+
+    @unittest.expectedFailure
+    def test_expected_failure(self):
+        """Test behaviour of expectedFailure"""
+        self.assertEqual(1, 2)
+
 -----------------------------------------
 Testing against multiple Python versions:
 -----------------------------------------

=== modified file 'po/duplicity.pot'
--- po/duplicity.pot	2015-07-31 15:58:16 +0000
+++ po/duplicity.pot	2015-08-01 12:09:10 +0000
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: Kenneth Loafman <kenneth@xxxxxxxxxxx>\n"
-"POT-Creation-Date: 2015-07-31 10:34-0500\n"
+"POT-Creation-Date: 2015-08-01 12:41+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@xxxxxx>\n"

=== modified file 'testing/__init__.py'
--- testing/__init__.py	2014-04-22 15:33:00 +0000
+++ testing/__init__.py	2015-08-01 12:09:10 +0000
@@ -21,7 +21,11 @@
 import os
 import sys
 import time
-import unittest
+
+if sys.version_info < (2, 7):
+    import unittest2 as unittest
+else:
+    import unittest
 
 from duplicity import backend
 from duplicity import globals

=== modified file 'testing/test_code.py'
--- testing/test_code.py	2015-07-31 15:01:07 +0000
+++ testing/test_code.py	2015-08-01 12:09:10 +0000
@@ -65,6 +65,7 @@
     @unittest.skipUnless(os.getenv('RUN_CODE_TESTS', None) == '1',
                          'Must set environment var RUN_CODE_TESTS=1')
     def test_pylint(self):
+        """Pylint test (requires pylint to be installed to pass)"""
         self.run_checker([
             "pylint",
             "-E",

=== modified file 'testing/unit/test_backend.py'
--- testing/unit/test_backend.py	2015-01-31 23:30:49 +0000
+++ testing/unit/test_backend.py	2015-08-01 12:09:10 +0000
@@ -256,7 +256,7 @@
         self.mock._move.return_value = True
         self.backend.move(self.local, self.remote)
         self.mock._move.assert_called_once_with(self.local, self.remote)
-        self.assertEquals(self.mock._put.call_count, 0)
+        self.assertEqual(self.mock._put.call_count, 0)
 
     def test_move_fallback_false(self):
         self.mock._move.return_value = False

=== modified file 'testing/unit/test_diffdir.py'
--- testing/unit/test_diffdir.py	2015-02-01 17:37:37 +0000
+++ testing/unit/test_diffdir.py	2015-08-01 12:09:10 +0000
@@ -130,7 +130,8 @@
                                    + "\n".join(changed_files))
 
     def test_diff2(self):
-        """Another diff test - this one involves multivol support"""
+        """Another diff test - this one involves multivol support
+        (requires rdiff to be installed to pass)"""
         sel1 = selection.Select(Path("testfiles/dir2"))
         diffdir.write_block_iter(diffdir.SigTarBlockIter(sel1.set_iter()),
                                  "testfiles/output/dir2.sigtar")

=== modified file 'testing/unit/test_tempdir.py'
--- testing/unit/test_tempdir.py	2014-12-12 14:39:54 +0000
+++ testing/unit/test_tempdir.py	2015-08-01 12:09:10 +0000
@@ -30,7 +30,7 @@
     def test_all(self):
         td = tempdir.default()
 
-        self.assert_(td.mktemp() != td.mktemp())
+        self.assertTrue(td.mktemp() != td.mktemp())
 
         dir = td.mktemp()
         os.mkdir(dir)


Follow ups