[Python-modules-commits] [python-testfixtures] 01/07: Import python-testfixtures_4.13.5.orig.tar.gz

Michael Fladischer fladi at moszumanska.debian.org
Thu Mar 16 11:06:33 UTC 2017


This is an automated email from the git hooks/post-receive script.

fladi pushed a commit to branch master
in repository python-testfixtures.

commit d53380c5c4fb5eee56cf76a2a3df379c8a842556
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date:   Thu Mar 16 11:54:06 2017 +0100

    Import python-testfixtures_4.13.5.orig.tar.gz
---
 .coveragerc                             |  1 -
 docs/changes.txt                        | 10 ++++++++--
 testfixtures/comparison.py              |  7 ++++---
 testfixtures/shouldraise.py             |  1 -
 testfixtures/tests/test_compare.py      |  6 ++++++
 testfixtures/tests/test_should_raise.py |  2 --
 testfixtures/version.txt                |  2 +-
 7 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/.coveragerc b/.coveragerc
index 5a84279..c127036 100644
--- a/.coveragerc
+++ b/.coveragerc
@@ -1,5 +1,4 @@
 [run]
-branch = True
 parallel = True
 
 [report]
diff --git a/docs/changes.txt b/docs/changes.txt
index 6e89e16..1a97f2a 100644
--- a/docs/changes.txt
+++ b/docs/changes.txt
@@ -3,7 +3,13 @@ Changes
 
 .. currentmodule:: testfixtures
 
-4.13.4 (6 February 2016)
+4.13.5 (1 March 2017)
+-------------------------
+
+- :func:`compare` now correctly compares nested empty dictionaries when using
+  ``ignore_eq=True``.
+
+4.13.4 (6 February 2017)
 ------------------------
 
 - Keep the `Reproducible Builds`__ guys happy.
@@ -13,7 +19,7 @@ Changes
 4.13.3 (13 December 2016)
 -------------------------
 
-- :func:`compare` now better handled equality comparison with ``ignore_eq=True``
+- :func:`compare` now better handles equality comparison with ``ignore_eq=True``
   when either of the objects being compared cannot be hashed.
 
 4.13.2 (16 November 2016)
diff --git a/testfixtures/comparison.py b/testfixtures/comparison.py
index 60837b4..a30d474 100644
--- a/testfixtures/comparison.py
+++ b/testfixtures/comparison.py
@@ -137,11 +137,12 @@ def _compare_mapping(x, y, context, obj_for_class):
                 ))
         else:
             same.append(key)
+
+    if not (x_not_y or y_not_x or diffs):
+        return
+
     lines = ['%s not as expected:' % obj_for_class.__class__.__name__]
     if same:
-        set_same = set(same)
-        if set_same == x_keys == y_keys:
-            return
         lines.extend(('', 'same:', repr(same)))
 
     x_label = context.x_label or 'first'
diff --git a/testfixtures/shouldraise.py b/testfixtures/shouldraise.py
index 3baefe1..9e7b49b 100644
--- a/testfixtures/shouldraise.py
+++ b/testfixtures/shouldraise.py
@@ -61,7 +61,6 @@ class ShouldRaise(object):
                         repr_actual, repr_expected
                     )
                     if repr_actual == repr_expected:
-                        print(str(comparison).split('\n'))
                         extra = [', attributes differ:']
                         extra.extend(str(comparison).split('\n')[2:-1])
                         message += '\n'.join(extra)
diff --git a/testfixtures/tests/test_compare.py b/testfixtures/tests/test_compare.py
index bff4086..30295cd 100644
--- a/testfixtures/tests/test_compare.py
+++ b/testfixtures/tests/test_compare.py
@@ -982,6 +982,12 @@ b
             "'y': 1 != 2"
             )
 
+    def test_nested_dict_empty_but_same(self):
+        compare(dict(x=dict()), dict(x=dict()), ignore_eq=True)
+
+    def test_nested_dict_empty_with_keys(self):
+        compare(dict(x=dict(x=1)), dict(x=dict(x=1)), ignore_eq=True)
+
     def test_tuple_list_different(self):
         self.checkRaises(
             (1, [2, 3, 5]), (1, [2, 4, 5]),
diff --git a/testfixtures/tests/test_should_raise.py b/testfixtures/tests/test_should_raise.py
index e7a708e..58ecdc5 100644
--- a/testfixtures/tests/test_should_raise.py
+++ b/testfixtures/tests/test_should_raise.py
@@ -270,7 +270,6 @@ class TestShouldRaise(TestCase):
         to_test()
 
     def test_identical_reprs(self):
-
         class AnnoyingException(Exception):
             def __init__(self, **kw):
                 self.other = kw.get('other')
@@ -279,7 +278,6 @@ class TestShouldRaise(TestCase):
             with ShouldRaise(AnnoyingException(other='bar')):
                 raise AnnoyingException(other='baz')
         except AssertionError as e:
-            print(repr(e))
             self.assertEqual(
                 C(AssertionError(
                     "AnnoyingException() raised, AnnoyingException() expected,"
diff --git a/testfixtures/version.txt b/testfixtures/version.txt
index 32d3e23..e0d9923 100644
--- a/testfixtures/version.txt
+++ b/testfixtures/version.txt
@@ -1 +1 @@
-4.13.4
+4.13.5

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-testfixtures.git



More information about the Python-modules-commits mailing list