Skip to content

Commit

Permalink
feat: swap tomllib with tomlkit
Browse files Browse the repository at this point in the history
  • Loading branch information
Zane Clark committed Oct 31, 2024
1 parent 8b52000 commit f9e9917
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/config/test_get_merged_config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import logging
import os
import tomllib
import tomlkit
from pathlib import Path
from unittest import mock

Expand All @@ -23,7 +23,7 @@

def get_connection_from_toml(file_path: Path, connection_name: str) -> dict:
with file_path.open("rb") as f:
connections = tomllib.load(f)
connections = tomlkit.load(f)
return connections[connection_name]


Expand Down
6 changes: 4 additions & 2 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import json
import logging
import os
import tomllib
import tomlkit
import tempfile
import unittest.mock as mock
from dataclasses import asdict
Expand All @@ -21,7 +21,7 @@

def get_connection_from_toml(file_path: Path, connection_name: str) -> dict:
with file_path.open("rb") as f:
connections = tomllib.load(f)
connections = tomlkit.load(f)
return connections[connection_name]


Expand Down Expand Up @@ -603,6 +603,7 @@ def test_main_deploy_config_folder(
)
)

# noinspection PyTypeChecker
args[args.index("DUMMY")] = d
expected_config["config_file_path"] = Path(d) / "schemachange-config.yml"

Expand Down Expand Up @@ -654,6 +655,7 @@ def test_main_deploy_modules_folder(
):
with mock.patch.dict(os.environ, {"SNOWFLAKE_PASSWORD": "password"}, clear=True):
with tempfile.TemporaryDirectory() as d:
# noinspection PyTypeChecker
args[args.index("DUMMY")] = d
expected_config["modules_folder"] = Path(d)

Expand Down

0 comments on commit f9e9917

Please sign in to comment.