import cleanup for xmlrunner
authorStefan Behnel <scoder@users.berlios.de>
Fri, 5 Mar 2010 14:05:58 +0000 (15:05 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Fri, 5 Mar 2010 14:05:58 +0000 (15:05 +0100)
runtests.py

index 21929c50c9363b3caba3027d1fee1ccacbcb016b..30a1e47ad3476566cd736a59dcda2d594d290cb9 100644 (file)
@@ -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)