[diffoscope] 02/03: tests: Also test whether the 2nd source of a difference is a string, not just the first

Chris Lamb chris at chris-lamb.co.uk
Thu Feb 2 23:49:31 UTC 2017


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

lamby pushed a commit to branch master
in repository diffoscope.

commit 2b2cb3c0b6b515e9bd10a3834dacca14428f6e3e
Author: Chris Lamb <lamby at debian.org>
Date:   Fri Feb 3 12:43:11 2017 +1300

    tests: Also test whether the 2nd source of a difference is a string, not just the first
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 tests/test_difference.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/tests/test_difference.py b/tests/test_difference.py
index 2bc255a..f4770f2 100644
--- a/tests/test_difference.py
+++ b/tests/test_difference.py
@@ -40,8 +40,12 @@ def test_too_long_diff_block_lines(monkeypatch):
     assert '[ 11 lines removed ]' in difference.unified_diff
 
 def test_non_str_arguments_to_source1_source2():
-    a = io.StringIO('a')
-    b = io.StringIO('b')
+    for x in (
+        (None, 'str'),
+        ('str', None),
+    ):
+        a = io.StringIO('a')
+        b = io.StringIO('b')
 
-    with pytest.raises(TypeError):
-        Difference.from_text_readers(a, b, a, b)
+        with pytest.raises(TypeError):
+            Difference.from_text_readers(a, b, *x)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git



More information about the Reproducible-commits mailing list