def test_should_not_duplicate_with_global_merge(tmpdir):
    """Assert merge unique in a first level. Issue #653"""
    settings_file_yaml = """
    default:
      SOME_KEY: "value"
      SOME_LIST:
        - "item_1"
        - "item_2"
        - "item_3"
    other:
      SOME_KEY: "new_value"
      SOME_LIST:
        - "item_4"
        - "item_5"
    even_other:
      SOME_KEY: "new_value_2"
      SOME_LIST:
        - "item_6"
        - "item_7"
    """
    tmpdir.join("settings.yaml").write(settings_file_yaml)
    settings = LazySettings(
        environments=True, settings_files=["settings.yaml"], merge_enabled=True
    )
    # settings.reload()
    assert settings.SOME_KEY == "value"
    assert settings.SOME_LIST == ["item_1", "item_2", "item_3"]

    other_settings = settings.from_env("other")
    assert other_settings.SOME_KEY == "new_value"
    assert other_settings.SOME_LIST == [
        "item_1",
        "item_2",
        "item_3",
        "item_4",
        "item_5",
    ]
Assert merge unique in a first level. Issue #653
tests/test_yaml_loader.py