mutmut
mutmut copied to clipboard
Can't run mutmut Windows 10
My project structure.
project
|-my_project\
|-tests\
|-venv.tests\
|-setup.cfg
My setup.cfg:
[mutmut]
runner="python -m unittest discover"
paths-to-mutate="my_project\"
tests-dir="tests\"
When I run python -m mutmut run from project I get an error:
Traceback (most recent call last):
File "C:\Users\...\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\...\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "X:\Projects\project\venv.tests\lib\site-packages\mutmut\__main__.py", line 784, in <module>
climain()
File "X:\Projects\project\venv.tests\lib\site-packages\click\core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "X:\Projects\project\venv.tests\lib\site-packages\click\core.py", line 717, in main
rv = self.invoke(ctx)
File "X:\Projects\project\venv.tests\lib\site-packages\click\core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "X:\Projects\project\venv.tests\lib\site-packages\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "X:\Projects\project\venv.tests\lib\site-packages\mutmut\__main__.py", line 74, in wrapper
f(*args, **kwargs)
File "X:\Projects\project\venv.tests\lib\site-packages\mutmut\__main__.py", line 254, in climain
post_mutation, use_patch_file))
File "X:\Projects\project\venv.tests\lib\site-packages\mutmut\__main__.py", line 352, in main
using_testmon=using_testmon
File "X:\Projects\project\venv.tests\lib\site-packages\mutmut\__main__.py", line 689, in time_test_suite
returncode = popen_streaming_output(test_command, feedback)
File "X:\Projects\project\venv.tests\lib\site-packages\mutmut\__main__.py", line 459, in popen_streaming_output
stderr=subprocess.PIPE
File "C:\Users\...\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "C:\Users\...\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1178, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
Hmm... Sounds like it isn't finding python. If you change the runner command to the absolute path to the python in the venv, does it work?
No, it doesn't help.
@nklapste maybe you can help?
@LLKoder could you try a config similar too:
[mutmut]
runner=C:\\path\\to\\your\\project\\venv\\Scripts\\python.exe -m unittest discover
For specifying your runner?
I found my runtime was tripping over python escaping \ weirdly.
Based on other issues, it appears that there are Windows users of mutmut, so this probably isnt a problem, but it is worth noting that dependency whatthepatch has some features which are not supported on Windows, and has no Windows CI to maintain support. https://github.com/cscorley/whatthepatch/issues/26 . However I noticed that mutmut tests depended patch & ed on unix, so maybe it is a relevant problem for Windows.
And there is no Windows CI for mutmut, or for https://github.com/TriOptima/tri.declarative or its dependencies. @nklapste / @boxed , do you have a preference for Windows CI provider?
(ah, I see the Travis CI here is using the new Windows Travis support. nice!)
This specific problem would be fixed by https://github.com/boxed/mutmut/pull/134
@jayvdb Does this mean this issue can be closed when #134 is merged?
Probably also fixed by #220.