Skip to content

Commit

Permalink
add tests config
Browse files Browse the repository at this point in the history
  • Loading branch information
samsja committed Sep 20, 2024
1 parent fa9fd11 commit e94d3c0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_configs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""
Tests all of the config file. usefull to catch mismatch key after a renaming of a arg name
Need to be run from the root folder
"""

import os
from zeroband.train import Config
import pytest
import tomli

config_file_names = [file for file in os.listdir("configs") if file.endswith(".toml")]

@pytest.mark.parametrize("config_file_name", config_file_names)
def test_load_config(config_file_name):
with open(f"configs/{config_file_name}", "rb") as f:
content = tomli.load(f)
config = Config(**content)
assert config is not None

0 comments on commit e94d3c0

Please sign in to comment.