aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--patchwork/tests/test_xmlrpc.py16
-rw-r--r--tox.ini3
2 files changed, 16 insertions, 3 deletions
diff --git a/patchwork/tests/test_xmlrpc.py b/patchwork/tests/test_xmlrpc.py
index 6dcbca9..4726fdf 100644
--- a/patchwork/tests/test_xmlrpc.py
+++ b/patchwork/tests/test_xmlrpc.py
@@ -13,6 +13,12 @@ from django.urls import reverse
from patchwork.tests import utils
+class ServerProxy(xmlrpc_client.ServerProxy):
+
+ def close(self):
+ self.__close()
+
+
@unittest.skipUnless(settings.ENABLE_XMLRPC,
'requires xmlrpc interface (use the ENABLE_XMLRPC '
'setting)')
@@ -20,7 +26,10 @@ class XMLRPCTest(LiveServerTestCase):
def setUp(self):
self.url = self.live_server_url + reverse('xmlrpc')
- self.rpc = xmlrpc_client.Server(self.url)
+ self.rpc = ServerProxy(self.url)
+
+ def tearDown(self):
+ self.rpc.close()
class XMLRPCGenericTest(XMLRPCTest):
@@ -55,7 +64,10 @@ class XMLRPCAuthenticatedTest(LiveServerTestCase):
self.user = utils.create_maintainer(self.project)
self.url = ('http://%s:%s@' + self.url[7:]) % (self.user.username,
self.user.username)
- self.rpc = xmlrpc_client.Server(self.url)
+ self.rpc = ServerProxy(self.url)
+
+ def tearDown(self):
+ self.rpc.close()
def test_patch_set(self):
patch = utils.create_patch(project=self.project)
diff --git a/tox.ini b/tox.ini
index 8ba7547..75d893e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -17,7 +17,8 @@ deps =
setenv =
DJANGO_SETTINGS_MODULE = patchwork.settings.dev
PYTHONDONTWRITEBYTECODE = 1
- py36: PYTHONWARNINGS = once,ignore::ResourceWarning:unittest.suite,ignore::ImportWarning:backports
+ PYTHONDEVMODE = 1
+ py36: PYTHONWARNINGS = once,ignore::ImportWarning:backports
py{37,38}: PYTHONWARNINGS = once
passenv =
http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY