From 06fe8a12e1c51e7ef80db41a283d0d5b80b735ed Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Wed, 7 Mar 2012 17:14:26 -0500 Subject: [PATCH] Cleaning up some hard-to-read tests. --- pecan/tests/test_conf.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/pecan/tests/test_conf.py b/pecan/tests/test_conf.py index 585c2b8..49d076c 100644 --- a/pecan/tests/test_conf.py +++ b/pecan/tests/test_conf.py @@ -100,46 +100,41 @@ class TestConf(TestCase): def test_config_missing_file(self): path = ('doesnotexist.py',) conf = configuration.Config({}) - - call_ = lambda path: conf.update(configuration.conf_from_file(os.path.join( + self.assertRaises(IOError, configuration.conf_from_file, os.path.join( __here__, 'test_config', *path - ))) - self.assertRaises(IOError, call_, path) + )) def test_config_missing_file_on_path(self): path = ('bad', 'bad', 'doesnotexist.py',) conf = configuration.Config({}) - call_ = lambda path: conf.update(configuration.conf_from_file(os.path.join( + self.assertRaises(IOError, configuration.conf_from_file, os.path.join( __here__, 'test_config', *path - ))) - self.assertRaises(IOError, call_, path) + )) def test_config_with_syntax_error(self): path = ('bad', 'syntaxerror.py') conf = configuration.Config({}) - call_ = lambda path: conf.update(configuration.conf_from_file(os.path.join( + self.assertRaises(SyntaxError, configuration.conf_from_file, os.path.join( __here__, 'test_config', *path - ))) - self.assertRaises(SyntaxError, call_, path) + )) def test_config_with_bad_import(self): path = ('bad', 'importerror.py') conf = configuration.Config({}) - call_ = lambda path: conf.update(configuration.conf_from_file(os.path.join( + self.assertRaises(ImportError, configuration.conf_from_file, os.path.join( __here__, 'test_config', *path - ))) - self.assertRaises(ImportError, call_, path) + )) def test_config_set_from_file(self): path = os.path.join(os.path.dirname(__file__), 'test_config', 'empty.py')