-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_run_with_user_global_config_file
fails if XDG_CONFIG_HOME
is set
#621
Comments
Hello Jason, Thanks for reporting this, I can confirm the problem when
I think you are right: https://github.com/adrienverge/yamllint/blob/3288d05/yamllint/cli.py#L184-L188. Do you think deleting / restoring |
Yeah.
Sure! |
Several environment variables can influence which config file yamllint chooses to use [1]. Before this change, if you set those environment variables and ran “python -m unittest discover”, then you could cause certain tests to use the wrong config file and fail. Fixes adrienverge#621. [1]: <https://github.com/adrienverge/yamllint/blob/152ba20f339588a872777eafb888f0073e83cafb/yamllint/cli.py#L180-L188>
Several environment variables can influence which config file yamllint chooses to use [1]. Before this change, if you set those environment variables and ran “python -m unittest discover”, then you could cause certain tests to use the wrong config file and fail. Fixes adrienverge#621. [1]: <https://github.com/adrienverge/yamllint/blob/152ba20f339588a872777eafb888f0073e83cafb/yamllint/cli.py#L180-L188>
Several environment variables can influence which config file yamllint chooses to use [1]. Before this change, if you set those environment variables and ran “python -m unittest discover”, then you could cause certain tests to use the wrong config file and fail. Fixes #621. [1]: <https://github.com/adrienverge/yamllint/blob/152ba20f339588a872777eafb888f0073e83cafb/yamllint/cli.py#L180-L188>
I’m running NixOS, and on my system, the
XDG_CONFIG_HOME
environment variable is set by default. This causes one of the unit tests to fail. You should be able to reproduce this issue on any system by running:XDG_CONFIG_HOME="$PWD" python -m unittest tests.test_cli.CommandLineTestCase.test_run_with_user_global_config_file
I can workaround the problem by doing this:
Here’s what I think that the problem is: The test sets the
HOME
variable in an attempt to get yamllint to load an alternative global configuration file, but yamllint doesn’t look in the user’s home directory for a global configuration ifXDG_CONFIG_HOME
is set.The text was updated successfully, but these errors were encountered: