def test_which_set():
 skip_if_no_sklearn()
 this_yaml = (test_yaml_which_set % {'which_set': 'train'})
 trainer = yaml_parse.load(this_yaml)
 trainer.main_loop()
 this_yaml = (test_yaml_which_set % {'which_set': ['train', 'test']})
 trainer = yaml_parse.load(this_yaml)
 trainer.main_loop()
 this_yaml = (test_yaml_which_set % {'which_set': 'valid'})
 try:
  trainer = yaml_parse.load(this_yaml)
  trainer.main_loop()
  raise AssertionError
 except ValueError:
  pass
 this_yaml = (test_yaml_which_set % {'which_set': 'bogus'})
 try:
  yaml_parse.load(this_yaml)
  raise AssertionError
 except ValueError:
  pass

def test_which_set ( ) : skip_if_no_sklearn ( ) this_yaml = ( test_yaml_which_set % { 'which_set' : 'train' } ) trainer = yaml_parse . load ( this_yaml ) trainer . main_loop ( ) this_yaml = ( test_yaml_which_set % { 'which_set' : [ 'train' , 'test' ] } ) trainer = yaml_parse . load ( this_yaml ) trainer . main_loop ( ) this_yaml = ( test_yaml_which_set % { 'which_set' : 'valid' } ) try : trainer = yaml_parse . load ( this_yaml ) trainer . main_loop ( ) raise AssertionError except ValueError : pass this_yaml = ( test_yaml_which_set % { 'which_set' : 'bogus' } ) try : yaml_parse . load ( this_yaml ) raise AssertionError except ValueError : pass
test which_set selector .