Skip to content

Commit

Permalink
Fix config unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoliver committed Aug 12, 2019
1 parent 97b4dfa commit 5bbdf57
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/cylc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1754,9 +1754,9 @@ def generate_triggers(self, lexpression, left_nodes, right, seq,
if (xtrig.func_name == 'wall_clock' and
self.cfg['scheduling']['cycling mode'] == (
INTEGER_CYCLING_TYPE)):
raise SuiteConfigError("ERROR: clock triggers are not "
"compatible with integer cycling.\n %s = %s" % (
label, xtrig.get_signature()))
raise SuiteConfigError(
"ERROR: clock triggers are not compatible with integer "
"cycling.\n %s = %s" % (label, xtrig.get_signature()))
self.xtrigger_mgr.add_trig(label, xtrig, self.fdir)
self.taskdefs[right].add_xtrig_label(label, seq)

Expand Down
8 changes: 4 additions & 4 deletions lib/cylc/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_xfunction_imports(self):
f.flush()
suite_config = SuiteConfig(suite="name_a_tree", fpath=f.name)
config = suite_config
self.assertTrue('tree' in config.xtriggers['qux'])
self.assertTrue('tree' in config.xtrigger_mgr.functx_map)
shutil.rmtree(temp_dir)

def test_xfunction_import_error(self):
Expand All @@ -76,7 +76,7 @@ def test_xfunction_import_error(self):
graph = '@oopsie => qux'
""")
f.flush()
with self.assertRaises(SuiteConfigError) as ex:
with self.assertRaises(ImportError) as ex:
SuiteConfig(suite="caiman_suite", fpath=f.name)
self.assertTrue("not found" in str(ex))
shutil.rmtree(temp_dir)
Expand Down Expand Up @@ -104,7 +104,7 @@ def test_xfunction_attribute_error(self):
graph = '@oopsie => qux'
""")
f.flush()
with self.assertRaises(SuiteConfigError) as ex:
with self.assertRaises(AttributeError) as ex:
SuiteConfig(suite="capybara_suite", fpath=f.name)
self.assertTrue("not found" in str(ex))
shutil.rmtree(temp_dir)
Expand Down Expand Up @@ -132,7 +132,7 @@ def test_xfunction_not_callable(self):
graph = '@oopsie => qux'
""")
f.flush()
with self.assertRaises(SuiteConfigError) as ex:
with self.assertRaises(ValueError) as ex:
SuiteConfig(suite="suite_with_not_callable", fpath=f.name)
self.assertTrue("callable" in str(ex))
shutil.rmtree(temp_dir)
Expand Down

0 comments on commit 5bbdf57

Please sign in to comment.