From d737ecd06313f6aa7da47bd305f5e32466b73135 Mon Sep 17 00:00:00 2001 From: Jeremy Maitin-Shepard Date: Mon, 30 Nov 2020 13:11:19 -0800 Subject: [PATCH] Fix nonascii_srcdir to work when non-ascii directories aren't supported Previously, the nonascii_srcdir in tests/test_build.py contained some logic to attempt to handle the case where non-ascii directories aren't supported, but it did not actually work because it fails to copy the test sources to the temporary directory. With this commit, the following test invocation, which previously failed, now pases: LANG=en_US.iso8859-1 python -m pytest test_build.py --- tests/test_build.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_build.py b/tests/test_build.py index 9dcf78165..80e068eeb 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -37,6 +37,8 @@ def nonascii_srcdir(request, rootdir, sphinx_test_tempdir): (rootdir / 'test-root').copytree(srcdir) except UnicodeEncodeError: srcdir = basedir / 'all' + if not srcdir.exists(): + (rootdir / 'test-root').copytree(srcdir) else: # add a doc with a non-ASCII file name to the source dir (srcdir / (test_name + '.txt')).write_text(dedent("""