One thing maybe worth trying (that I think would be a good idea across BrainGlobe) is to monkeypatch Path.home() for all tests when not running on CI. It looks like there's a few constant variables that need to be adapted for the patching to work. This way
we test a slightly more real-life case on CI (Path.home() is not patched, but that's fine, because the CI does not have a user set up.)
we locally keep ~./brainglobe/ (user data) and ~/.brainglobe-tests/.brainglobe/ (tests interacting with fake user data) always completely separate.
E.g.
test_config_file.test_config_edit
(see https://github.com/brainglobe/brainglobe-atlasapi/pull/300)Comment from @alessandrofelder: