test.test_examples: Convert pathlib-specific class to string.
authorWilliam D. Jones <thor0505@comcast.net>
Mon, 5 Aug 2019 01:52:23 +0000 (21:52 -0400)
committerwhitequark <cz@m-labs.hk>
Tue, 20 Aug 2019 00:54:10 +0000 (00:54 +0000)
subprocess.check_call iterates over its arguments to check for spaces
and tabs, and on Windows, the pathlib-specific WindowsPath is not
iterable.

nmigen/test/test_examples.py

index bf729c56819b46c7cfa4656ed07346bce00f0461..e428a5e934282f26abe9434154c157e927283dac 100644 (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