Skip to content

Commit

Permalink
Fix nonascii_srcdir to work when non-ascii directories aren't supported
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jbms committed Nov 30, 2020
1 parent 9cf2826 commit d737ecd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("""
Expand Down

0 comments on commit d737ecd

Please sign in to comment.