diff --git a/tests/test_init.py b/tests/test_init.py
index <HASH>..<HASH> 100644
--- a/tests/test_init.py
+++ b/tests/test_init.py
@@ -126,6 +126,9 @@ class InitTests(unittest.TestCase):
             else:
                 modname = '%s.%s' % (module.__name__, modname)
 
+            if sys.version_info < (3,) and sys.platform == 'win32' and b'\r\n' in full_code:
+                full_code = full_code.replace(b'\r\n', b'\n')
+
             imports = set([])
             module_node = ast.parse(full_code, filename=full_path)
             walk_ast(module_node, modname, imports)
Handle test environments on Windows with Python 2.x using git autocrlf