test.test_examples: Convert pathlib-specific class to string.

subprocess.check_call iterates over its arguments to check for spaces
and tabs, and on Windows, the pathlib-specific WindowsPath is not
iterable.
This commit is contained in:
William D. Jones 2019-08-04 21:52:23 -04:00 committed by whitequark
parent 5ad409e897
commit c934fc66e9

View file

@ -8,7 +8,7 @@ from .tools import *
def example_test(name):
path = (Path(__file__).parent / ".." / ".." / "examples" / name).resolve()
def test_function(self):
subprocess.check_call([sys.executable, path, "generate"], stdout=subprocess.DEVNULL)
subprocess.check_call([sys.executable, str(path), "generate"], stdout=subprocess.DEVNULL)
return test_function