Skip to content

Commit

Permalink
Create test for config_base.py (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
farzadab authored Sep 23, 2024
1 parent 8515b3d commit fa88073
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ultravox/training/config_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def get_train_args(override_sys_args: Optional[List[str]] = None) -> TrainConfig
override_sys_args: The command line arguments. If None, sys.argv[1:] is used.
This is mainly useful for testing.
"""
args = override_sys_args or sys.argv[1:]
args = sys.argv[1:] if override_sys_args is None else override_sys_args

return simple_parsing.parse(
config_class=TrainConfig,
Expand Down
7 changes: 7 additions & 0 deletions ultravox/training/config_base_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from ultravox.training import config_base


def test_can_create_train_config():
# override args to [], otherwise pytest arguments will be used
args = config_base.get_train_args([])
assert isinstance(args, config_base.TrainConfig)

0 comments on commit fa88073

Please sign in to comment.