Bug 7026: misleading diagnostics when locale resources aren't built

This problem is from setup.py test, so ensure that there's a 'build'
directory before running test.
This commit is contained in:
John Ralls 2014-03-06 15:37:47 -08:00
parent 4dd543c323
commit e76d3f91bf

View File

@ -262,6 +262,7 @@ class test(Command):
description = "run all unit tests" description = "run all unit tests"
user_options = [] user_options = []
def initialize_options(self): def initialize_options(self):
pass pass
@ -269,6 +270,8 @@ class test(Command):
pass pass
def run(self): def run(self):
if not os.path.exists('build'):
raise RuntimeError("No build directory. Run `python setup.py build` before trying to run tests.")
os.environ['GRAMPS_RESOURCES'] = '.' os.environ['GRAMPS_RESOURCES'] = '.'
all_tests = unittest.TestLoader().discover('.', pattern='*_test.py') all_tests = unittest.TestLoader().discover('.', pattern='*_test.py')
unittest.TextTestRunner(verbosity=self.verbose).run(all_tests) unittest.TextTestRunner(verbosity=self.verbose).run(all_tests)