diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2020-07-01 20:49:30 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-07-01 20:49:30 -0400 |
| commit | a4eb1127303fbe514ab8f77d6c3896614de02c5d (patch) | |
| tree | 7bad818fc6efcdd297f222a4de5bc13111825400 | |
| parent | 253d03cad23ed022d020ae635ce419255240feef (diff) | |
| download | external_python_setuptools-a4eb1127303fbe514ab8f77d6c3896614de02c5d.tar.gz external_python_setuptools-a4eb1127303fbe514ab8f77d6c3896614de02c5d.tar.bz2 external_python_setuptools-a4eb1127303fbe514ab8f77d6c3896614de02c5d.zip | |
Fix failing test in test_fileutil by adapting expectation based on Python version.
| -rw-r--r-- | distutils/tests/py35compat.py | 9 | ||||
| -rw-r--r-- | distutils/tests/test_filelist.py | 5 |
2 files changed, 13 insertions, 1 deletions
diff --git a/distutils/tests/py35compat.py b/distutils/tests/py35compat.py index 3eb86b5f..0c755261 100644 --- a/distutils/tests/py35compat.py +++ b/distutils/tests/py35compat.py @@ -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)') diff --git a/distutils/tests/test_filelist.py b/distutils/tests/test_filelist.py index c71342d0..71fde2b7 100644 --- a/distutils/tests/test_filelist.py +++ b/distutils/tests/test_filelist.py @@ -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 |
