Repository navigation
test: isolate root directory checks from inherited XDG settings - #622
Merged
gaborbernat merged 2 commits intoOct 17, 2026
Merged
Conversation
Root-redirection tests expect the default site directories, but the _as_root fixture only changes getuid(). XDG_DATA_DIRS and XDG_CONFIG_DIRS inherited from a desktop session change those paths and cause twelve tests to fail. Make the fixture depend on the existing _clear_xdg_env fixture. Each test can still set its own XDG values after fixture setup. Validation: the full suite passes with the host environment intact: 2233 passed, 125 skipped. Ruff, type and whitespace checks pass.
gaborbernat
approved these changes
Oct 17, 2026
gaborbernat
enabled auto-merge (squash)
October 17, 2026 18:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The root-redirection tests expect default site directories such as
/usr/local/shareand/etc/xdg. The_as_rootfixture changesgetuid(), but leaves the host's XDG variables in place. On a desktop session withXDG_DATA_DIRSandXDG_CONFIG_DIRSset, twelve tests fail because the library correctly uses those configured paths.Fix
Make
_as_rootdepend on the existing_clear_xdg_envfixture. The root tests then start from the environment their assertions expect. Tests that exercise XDG overrides still set their own values after fixture setup.Validation
This changes test setup only.