Skip to content

Commit eaf1fa3

Browse files
committed
test(toml): improve path assertion in arbitrary type test
Replace string-based assertion with proper TOML parsing and Path object comparison for more robust testing of serialization behavior.
1 parent 6c3f619 commit eaf1fa3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/test_confdantic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ class ArbitraryTomlModel(Confdantic):
217217

218218
model.save(str(filepath), comments=False, serialize_unsupported=True)
219219
content = filepath.read_text()
220-
expected_path = str(base_path)
221-
assert f'base_path = "{expected_path}"' in content
220+
parsed = tomlkit.loads(content)
221+
assert Path(parsed["base_path"]) == base_path
222222

223223

224224
def test_save_toml_with_nested_boolean_comments(temp_dir):

0 commit comments

Comments
 (0)