pytest-cookies
pytest-cookies copied to clipboard
Pytest-cookies fails on Windows (YAML config erroneous)
The YAML config is built by simple string formatting in https://github.com/hackebrot/pytest-cookies/blob/master/src/pytest_cookies/plugin.py
But since on Windows, filepaths use backslashes, this makes an invalid YAML file with wrong escape sequences :
while scanning a double-quoted scalar
in "C:\Users\Pascal\AppData\Local\Temp\pytest-of-Pascal\pytest-67\user_dir0\config", line 2, column 20
expected escape sequence of 8 hexadecimal numbers, but found 's'
in "C:\Users\Pascal\AppData\Local\Temp\pytest-of-Pascal\pytest-67\user_dir0\config", line 2, column 25
So this config should be dumped with a proper YAML parser.
For some reason, all works with old cookiecutter==1.7.2, probably the parser it uses is different
Simplest solution that avoids adding dependencies is to dump the config as JSON, since YAML is a superset of JSON.
I think this is an issue with poyo, which is used by cookiecutter < 2.
I'm experiencing this as well when running the pyramid-cookiecutter-starter tests on windows. Is there a workaround I can use?
Try my fork as described in https://github.com/hackebrot/pytest-cookies/issues/41