Commit a4eb1127 authored by Jason R. Coombs's avatar Jason R. Coombs

Fix failing test in test_fileutil by adapting expectation based on Python version.

parent 253d03ca
......@@ -66,3 +66,12 @@ vars(subprocess).setdefault(
'_optim_args_from_interpreter_flags',
_optim_args_from_interpreter_flags,
)
def adapt_glob(regex):
"""
Supply legacy expectation on Python 3.5
"""
if sys.version_info > (3, 6):
return regex
return regex.replace('(?s:', '').replace(r')\Z', r'\Z(?ms)')
......@@ -12,6 +12,9 @@ import test.support
from test.support import captured_stdout, run_unittest
from distutils.tests import support
from .py35compat import adapt_glob
MANIFEST_IN = """\
include ok
include xo
......@@ -60,7 +63,7 @@ class FileListTestCase(support.LoggingSilencer,
('foo????', r'(?s:foo[^%(sep)s][^%(sep)s][^%(sep)s][^%(sep)s])\Z'),
(r'foo\\??', r'(?s:foo\\\\[^%(sep)s][^%(sep)s])\Z')):
regex = regex % {'sep': sep}
self.assertEqual(glob_to_re(glob), regex)
self.assertEqual(glob_to_re(glob), adapt_glob(regex))
def test_process_template_line(self):
# testing all MANIFEST.in template patterns
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment