Skip to content

Commit

Permalink
added very basic test for named configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Qwlouse committed Jan 16, 2016
1 parent 8d1db9f commit ad5eba7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,20 @@ def foo():

with pytest.raises(KeyError):
ex.run(config_updates={'a': {'c': 5}})


def test_using_a_named_config(ex):
@ex.config
def cfg():
a = 1

@ex.named_config
def ncfg():
a = 10

@ex.main
def run(a):
return a

assert ex.run().result == 1
assert ex.run(named_configs=['ncfg']).result == 10

0 comments on commit ad5eba7

Please sign in to comment.