From 47b3047423c543c0efccbe2989e9947d4284e923 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 5 Mar 2010 15:05:58 +0100 Subject: [PATCH] import cleanup for xmlrunner --- runtests.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/runtests.py b/runtests.py index 21929c50..30a1e47a 100644 --- a/runtests.py +++ b/runtests.py @@ -880,17 +880,11 @@ if __name__ == '__main__': os.path.join(sys.prefix, 'lib', 'python'+sys.version[:3], 'test'), 'pyregr')) - xml_output_dir = options.xml_output_dir - if xml_output_dir: - try: - from xmlrunner import XMLTestRunner - except ImportError: - sys.stderr.write( - "Failed to import xmlrunner.XMLTestRunner, no XML output available\n") - xml_output_dir = None - - if xml_output_dir: - test_runner = XMLTestRunner(output=xml_output_dir, verbose=options.verbosity > 0) + if options.xml_output_dir: + sys.path.append('.') + from xmlrunner import XMLTestRunner + test_runner = XMLTestRunner(output=options.xml_output_dir, + verbose=options.verbosity > 0) else: test_runner = unittest.TextTestRunner(verbosity=options.verbosity) -- 2.26.2