From e2c345100152fc7f2638ec8c3fd117cb67959c26 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Wed, 8 Jan 2020 18:23:34 +0530 Subject: [PATCH] Delete tmpdir with rmtree to handle Unicode paths pytest (rather py.path.local) does not handle non-ASCII paths properly on Windows with Python 2, but Python's builtin shutil.rmtree() does. Co-authored-by: Pradyun Gedam --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 0b8496856f5..16b5c6202e9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -103,7 +103,7 @@ def tmpdir(request, tmpdir): # This should prevent us from needing a multiple gigabyte temporary # directory while running the tests. if not request.config.getoption("--keep-tmpdir"): - tmpdir.remove(ignore_errors=True) + shutil.rmtree(six.text_type(tmpdir), ignore_errors=True) @pytest.fixture(autouse=True)