Currently, each DNS test case first checks if DNS is configured
by creating and deleting a test zone. This takes quite a lot of time.

This patch moves the check to the setUpClass method, so the check is
only done once for all the tests.



On my VM, this makes the DNS plugin tests 50% faster, saving about half a minute for each test run.

--
PetrĀ³
From a9098f77bf89d1f44ea9ec335e55f05f086e373b Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Wed, 28 Mar 2012 04:42:23 -0400
Subject: [PATCH] Move DNS test skipping to class setup

Currently, each DNS test case first checks if DNS is configured
by creating and deleting a test zone. This takes quite a lot of time.

This patch moves the check to the setUpClass method, so the check is
only done once for all the tests.
---
 tests/test_xmlrpc/test_dns_plugin.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test_xmlrpc/test_dns_plugin.py b/tests/test_xmlrpc/test_dns_plugin.py
index 1e5ab7917f47b713f226764885035ff6b4ac90cd..911c77371950df863d797f4f01efd4bd46084797 100644
--- a/tests/test_xmlrpc/test_dns_plugin.py
+++ b/tests/test_xmlrpc/test_dns_plugin.py
@@ -47,8 +47,8 @@
 
 class test_dns(Declarative):
 
-    def setUp(self):
-        super(test_dns, self).setUp()
+    @classmethod
+    def setUpClass(cls):
         try:
            api.Command['dnszone_add'](dnszone1,
                idnssoamname = dnszone1_mname,
-- 
1.7.7.6

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to