-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|