1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-24 00:37:56 +00:00

Merge pull request #4142 from step21/master

Explicitly convert environment variable to str to address #4136
This commit is contained in:
TW 2018-10-31 13:48:13 +01:00 committed by GitHub
commit 44d41e3fa6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -30,8 +30,8 @@
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def clean_env(tmpdir_factory, monkeypatch): def clean_env(tmpdir_factory, monkeypatch):
# avoid that we access / modify the user's normal .config / .cache directory: # avoid that we access / modify the user's normal .config / .cache directory:
monkeypatch.setenv('XDG_CONFIG_HOME', tmpdir_factory.mktemp('xdg-config-home')) monkeypatch.setenv('XDG_CONFIG_HOME', str(tmpdir_factory.mktemp('xdg-config-home')))
monkeypatch.setenv('XDG_CACHE_HOME', tmpdir_factory.mktemp('xdg-cache-home')) monkeypatch.setenv('XDG_CACHE_HOME', str(tmpdir_factory.mktemp('xdg-cache-home')))
# also avoid to use anything from the outside environment: # also avoid to use anything from the outside environment:
keys = [key for key in os.environ if key.startswith('BORG_')] keys = [key for key in os.environ if key.startswith('BORG_')]
for key in keys: for key in keys:

View file

@ -68,7 +68,7 @@ class MockArgs:
@pytest.fixture @pytest.fixture
def keys_dir(self, request, monkeypatch, tmpdir): def keys_dir(self, request, monkeypatch, tmpdir):
monkeypatch.setenv('BORG_KEYS_DIR', tmpdir) monkeypatch.setenv('BORG_KEYS_DIR', str(tmpdir))
return tmpdir return tmpdir
@pytest.fixture(params=( @pytest.fixture(params=(