Skip to content

Commit

Permalink
TMP
Browse files Browse the repository at this point in the history
  • Loading branch information
mih committed Sep 24, 2024
1 parent 807fc6b commit f37cf4d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 0 additions & 3 deletions datasalad/settings/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ def __getitem__(self, key: str) -> Setting:

def __setitem__(self, key: str, value: Setting) -> None:
name = self.get_varname_from_key(key)
print(f'NAME {name}')
print(f'ENV {environ.keys()}')
environ[name] = str(value.value)
print(f'AFTERENV {environ.keys()}')

def get(self, key, default: Any = None) -> Setting:
try:
Expand Down
10 changes: 8 additions & 2 deletions datasalad/settings/tests/test_env.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from os import environ
from os import (
environ,
name as os_name,
)
from unittest.mock import patch

import pytest
Expand Down Expand Up @@ -74,7 +77,10 @@ def test_envsrc_get_ambiguous(monkeypatch, caplog):
assert env[target_key].value in ('würg', target_value)
# we saw a log message complaining about the ambiguous
# key
assert 'multiple' in caplog.text
if os_name not in ('os2', 'nt'):
# not testing on plaforms where Python handles vars
# in case insensitive manner
assert 'multiple' in caplog.text


def test_envsrc_set():
Expand Down

0 comments on commit f37cf4d

Please sign in to comment.