CleanCut / green

Green is a clean, colorful, fast python test runner.
MIT License
793 stars 75 forks source link

Green does not seem to work when there are whitespaces in directory path (on Windows) #176

Closed acabarbaye closed 4 years ago

acabarbaye commented 6 years ago

I tried to run green in a folder with such a path and I get the following error.

C:\Users\me\OneDrive - custom\Documents\GitHub\project (master)
λ pipenv run green
Traceback (most recent call last):
  File "C:\Users\me\scoop\apps\python\current\Lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\me\scoop\apps\python\current\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\me\.virtualenvs\project-mKyzmigV\Scripts\green.exe\__main__.py", line 9, in <module>
  File "c:\users\me\.virtualenvs\project-mkyzmigv\lib\site-packages\green\cmdline.py", line 69, in main
    result = run(test_suite, stream, args, testing)
  File "c:\users\me\.virtualenvs\project-mkyzmigv\lib\site-packages\green\runner.py", line 88, in run
    for target in toParallelTargets(suite, args.targets)]
  File "c:\users\me\.virtualenvs\project-mkyzmigv\lib\site-packages\green\loader.py", line 342, in toParallelTargets
    proto_test_list = toProtoTestList(suite)
  File "c:\users\me\.virtualenvs\project-mkyzmigv\lib\site-packages\green\loader.py", line 326, in toProtoTestList
    toProtoTestList(i, test_list, doing_completions)
  File "c:\users\me\.virtualenvs\project-mkyzmigv\lib\site-packages\green\loader.py", line 318, in toProtoTestList
    getattr(suite, exception_method)()
AttributeError: 'ModuleImportFailure' object has no attribute 'C:\Users\me\OneDrive'
CleanCut commented 6 years ago

I can't reproduce the error on macOS, and I don't have access to Windows. Can you provide the output when you add verbose debugging output? (-ddd)

@dougthor42 Would you be willing to see if you could reproduce this?

CleanCut commented 6 years ago

I'm sorry, but I don't have Windows myself. In the absence of a volunteer to help you I am afraid the answer is going to have to be "green doesn't support spaces in directory names on Windows".

If there is a windows guru out there (@MinchinWeb ?) who would like to take a shot at this, feel free to reopen.

samtayuk commented 4 years ago

I'm having this issue too. Has there been any planned fixes?

CleanCut commented 4 years ago

@samtayuk I haven't planned anything, no. But now that there are reports from two people, and I actually have access to Windows 10 via a virtual machine on VMWare, perhaps I may actually find the time to look into this. We could get lucky, and it might be something simple. 🤞

bkmd11 commented 4 years ago

I am interested in trying to figure this bug out, would that be ok?

CleanCut commented 4 years ago

@bkmd11 Absolutely!

CleanCut commented 4 years ago

Fix included in 3.1.3, just released.