Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Aug 20, 2019

Conversation

cr1901
Copy link
Contributor

@cr1901 cr1901 commented Aug 5, 2019

subprocess.check_call iterates over its arguments to check for spaces and tabs, and on Windows, the pathlib-specific WindowsPath is not iterable.

Before this change, the all tests in test_examples.py would fail with an error like this:

William@William-THINK MINGW64 ~/src/nmigen
$ python3 -m unittest
..............................................................................................EEEEEEEEEEEEE..........................................................................................................................................................................................................................................................................................................................................................
======================================================================
ERROR: test_alu (nmigen.test.test_examples.ExamplesTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:/msys64/home/William/src/nmigen\nmigen\test\test_examples.py", line 11, in test_function
    subprocess.check_call([sys.executable, path, "generate"], stdout=subprocess.DEVNULL)
  File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 342, in check_call
    retcode = call(*popenargs, **kwargs)
  File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 323, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 1119, in _execute_child
    args = list2cmdline(args)
  File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 530, in list2cmdline
    needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'WindowsPath' is not iterable

After this change, all tests pass successfully:

William@William-THINK MINGW64 ~/src/nmigen
$ python3 -m unittest
.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 453 tests in 57.663s

OK

subprocess.check_call iterates over its arguments to check for spaces
and tabs, and on Windows, the pathlib-specific WindowsPath is not
iterable.
@codecov
Copy link

codecov bot commented Aug 5, 2019

Codecov Report

Merging #168 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #168   +/-   ##
=======================================
  Coverage   80.46%   80.46%           
=======================================
  Files          32       32           
  Lines        5390     5390           
  Branches     1168     1168           
=======================================
  Hits         4337     4337           
  Misses        914      914           
  Partials      139      139

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 434b686...8909835. Read the comment docs.

@whitequark whitequark merged commit c934fc6 into m-labs:master Aug 20, 2019
@whitequark
Copy link
Contributor

Thanks, not sure how this fell between the cracks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants