diff Tests/Tests.py @ 83:3f2170efa8d2

patches for python3
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 23 Jun 2016 18:04:59 +0200
parents 5920954287dd
children 0401ef51f5c1
line wrap: on
line diff
--- a/Tests/Tests.py	Tue Jun 21 16:33:42 2016 +0200
+++ b/Tests/Tests.py	Thu Jun 23 18:04:59 2016 +0200
@@ -129,6 +129,11 @@
 
 class Orthanc(unittest.TestCase):
     def setUp(self):
+        if (sys.version_info >= (3, 0)):
+            # Remove annoying warnings about unclosed socket in Python 3
+            import warnings
+            warnings.simplefilter("ignore", ResourceWarning)
+
         DropOrthanc(_LOCAL)
         DropOrthanc(_REMOTE)
         UninstallLuaCallbacks()
@@ -531,7 +536,7 @@
 
         self.assertNotEqual('hello', DoGet(_REMOTE, '/instances/%s/content/0010-0010' % i).strip())
         #self.assertNotEqual('world', DoGet(_REMOTE, '/instances/%s/content/0010-0020' % i).strip())
-        self.assertEqual('LOGIQBOOK', DoGet(_REMOTE, '/instances/%s/content/0008-1010' % i).strip())        
+        self.assertEqual('LOGIQBOOK', DoGet(_REMOTE, '/instances/%s/content/0008-1010' % i).strip())
         DoGet(_REMOTE, '/instances/%s/content/6003-1010' % i)  # Some private tag
 
         self.assertEqual('hello', DoGet(_REMOTE, '/instances/%s/content/0010-0010' % j).strip())