From c4a3290bb83fc80fbfc0aa7c7bf76157fda4a75b 2014-05-21 04:26:55
From: MinRK <benjaminrk@gmail.com>
Date: 2014-05-21 04:26:55
Subject: [PATCH] Backport PR #5866: Make test robust against differences in line endings

git on Windows can change line endings on checkout, which was leading to a test failure.

---

diff --git a/IPython/utils/tests/test_openpy.py b/IPython/utils/tests/test_openpy.py
index 58d0ff2..d71ffb8 100644
--- a/IPython/utils/tests/test_openpy.py
+++ b/IPython/utils/tests/test_openpy.py
@@ -24,8 +24,8 @@ def test_read_file():
 def test_source_to_unicode():
     with io.open(nonascii_path, 'rb') as f:
         source_bytes = f.read()
-    nt.assert_equal(openpy.source_to_unicode(source_bytes, skip_encoding_cookie=False),
-                    source_bytes.decode('iso-8859-5'))
+    nt.assert_equal(openpy.source_to_unicode(source_bytes, skip_encoding_cookie=False).splitlines(),
+                    source_bytes.decode('iso-8859-5').splitlines())
 
     source_no_cookie = openpy.source_to_unicode(source_bytes, skip_encoding_cookie=True)
     nt.assert_not_in(u'coding: iso-8859-5', source_no_cookie)