Closed naglis closed 2 months ago
Nice find, and thanks for the PR!
(I suspect due to it being a Node environment?).
Sigh, unfortunately not. That's baggage from YAML 1.1, which interpreted as boolean several literal values (True
, Yes
, On
). In YAML 1.2 this is no longer the case, but lots of YAML parsers do not use that spec by default. One reason for that is that a lot of Kubernetes YAML files rely on this shortcut.
With that in mind, I think using DUMMY_CONVERSION: 1
would be less confusing. Are you ok with that? If yes, I can make this change and merge the PR.
With that in mind, I think using
DUMMY_CONVERSION: 1
would be less confusing. Are you ok with that? If yes, I can make this change and merge the PR.
Sure!
DUMMY_CONVERSION: True
is treated as a boolean value in YAML. As a result, during GitHub CI the environment variable setup during tests is formatted asDUMMY_CONVERSION=true
(I suspect due to it being a Node environment?).The value is used in tests and passed as the
condition
to thepytest.mark.skipif
decorator. Theskipif
condition
can be either abool
orstr
. When it is astr
(our case, as we useos.environ.get()
), it is treated as a condition string by pytest.Since the condition string is
eval()
ed by pytest, trying to evaluatetrue
results in:This wraps the value in single-quotes to avoid the value being treated as boolean in YAML.
I've came across it when trying to use this approach in another PR. I suspect it is not failing in its current use since the other
skipif
condition is checked and matches first.