The -k expression works with double quotes but not single quotes
See original GitHub issueWhen using single quotes and trying a conjunction of expressions:
-k 'vet_a and vet_a'
I get the error message:
ERROR: file or directory not found: and
I finally tried double quotes and it worked.
Note: the docs and -h help text using single quotes in the -k examples so at least update those as a quick workaround…
pytest 6.2.4 Windows 8.1
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
The real difference between 'single quotes' and “double ...
Either two double "" or single '' quote marks next to each other can represent an empty string containing no characters at all....
Read more >“Double Quotes” vs 'Single Quotes' vs `Backticks` in ...
The same theory applies to double quotes, and you have to use a backslash to escape any double quotes inside double quotes.
Read more >comparisions only work enclosed by single quotes, not ...
Maybe am I missing something obvious, but it looks like in some case string enclosed by double quotes in CEL expressions create compilation ......
Read more >Difference Between Single and Double Quotes in Shell Script ...
Double quotes are similar to single quotes except that it allows the shell to interpret dollar sign ($), backtick(`), backslash(\) and ...
Read more >Difference between single quotes and double ... - Stack Overflow
You'll want to use single quotes where you want double quotes to appear inside the string (e.g. for html attributes) without having to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
On unix systems,
'
is the better option because it avoids shell interpolation.On windows systems, looks like the correct quoting is double quotes (at least according to a random Stack Overflow answer…).
(edit: NOTE: see comments below) So it would be nice I suppose for pytest to use double quotes on windows and single quotes everywhere else in its help text for
-k
(and any other options which use quotes in their examples, if any).PR welcome!
-h
output is set here: https://github.com/pytest-dev/pytest/blob/176d2d7b4e21b19fb08afdb3f9db61495eff5647/src/_pytest/mark/__init__.py#L86Also, doesn’t
-m
option have the same behavior about quotes as-k
?