kaste / PyTest

pytest runner and view annotator for sublime text
21 stars 6 forks source link

shlex everythig #17

Closed jgirardet closed 5 years ago

jgirardet commented 5 years ago

I miss something. If you split first, How do you expand ?

kaste commented 5 years ago

expand takes a (str|List|Dict) as first argument.

The idea is

pytest = '$folder'
shlex.split('$folder')  #=> ['$folder']
expand(['$folder'], vars)  #=> ['/my fol/der /with /spaces']

but if you do it the other way


expand('$folder')  #=> '/my fol/der /with /spaces'
shlex.split('/my fol/der /with /spaces')  #=> ['/my', 'fol/der', '/with', '/spaces']
jgirardet commented 5 years ago

_expand/expand_variables was confusing to me. I'll look at it tomorrow or maybe next week.

jgirardet commented 5 years ago

Hi, I was thinking to it seems that the thing is not so simple to do:

2 use cases about pytest parameter: a- /my folder/whit spaces/pytest # expandable b- poetry|pipenv|... run pytest #no expand should be needed

Mix of two seems not very useful. depending the case you want to split space or not but it's not easy to guess.

My proposal :

kaste commented 5 years ago

Yes, you're correct.

For b and c we cannot split at all! Thanks for ppointing that out.

kaste commented 5 years ago

We also can't split .\.venv\Scripts\pytest (relative paths to the working dir). So, I suppose we just don't do it at all. Instead of 'poetry run pytest' users have to spell that ['poetry', 'run', 'pytest'] in the settings.