From c3335f92eeefa533d254991f99b229e56a4d1eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20David=20Ib=C3=A1=C3=B1ez?= Date: Sun, 26 May 2013 10:26:10 +0200 Subject: [PATCH] tests: get nice error when test module is broken --- test/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/__init__.py b/test/__init__.py index 024476b..b224393 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -41,10 +41,14 @@ names = ['blob', 'commit', 'config', 'diff', 'index', 'note', 'oid', 'refs', def test_suite(): # Sometimes importing pygit2 fails, we try this first to get an - # informative traceback + # informative traceback. import pygit2 - # Go + # Check the test modules import correctly, to get a nice error if one + # does not. modules = ['test.test_%s' % n for n in names] + for module in modules: + __import__(module) + # Go return unittest.defaultTestLoader.loadTestsFromNames(modules)