Преглед изворни кода

Cope with / no longer being escaped on Python 3.7.

Jelmer Vernooij пре 7 година
родитељ
комит
e05671b1bb
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      dulwich/tests/test_ignore.py

+ 5 - 0
dulwich/tests/test_ignore.py

@@ -21,6 +21,7 @@
 """Tests for ignore files."""
 
 from io import BytesIO
+import re
 import unittest
 
 from dulwich.ignore import (
@@ -73,6 +74,10 @@ class TranslateTests(unittest.TestCase):
 
     def test_translate(self):
         for (pattern, regex) in TRANSLATE_TESTS:
+            if re.escape(b'/') == b'/':
+                # Slash is no longer escaped in Python3.7, so undo the escaping
+                # in the expected return value..
+                regex = regex.replace(b'\\/', b'/')
             self.assertEqual(
                 regex, translate(pattern),
                 "orig pattern: %r, regex: %r, expected: %r" %