File fix-tests.patch of Package python-gevent

From: Antonio Larrosa <alarrosa@suse.com>
Subject: Fix failing tests

- ssl.OP_NO_COMPRESSION is set by default by ssl.
- thread_ident can be represented as a negative hex number now,
  so replace the negative sign with the regex too, and not just the number.
Index: gevent-1.4.0/src/greentest/2.7/test_ssl.py
===================================================================
--- gevent-1.4.0.orig/src/greentest/2.7/test_ssl.py
+++ gevent-1.4.0/src/greentest/2.7/test_ssl.py
@@ -742,14 +742,14 @@ class ContextTests(unittest.TestCase):
     def test_options(self):
         ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
         # OP_ALL | OP_NO_SSLv2 | OP_NO_SSLv3 is the default value
-        self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3,
+        self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3 | ssl.OP_NO_COMPRESSION,
                          ctx.options)
         ctx.options |= ssl.OP_NO_TLSv1
-        self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3 | ssl.OP_NO_TLSv1,
+        self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3 | ssl.OP_NO_COMPRESSION | ssl.OP_NO_TLSv1,
                          ctx.options)
         if can_clear_options():
             ctx.options = (ctx.options & ~ssl.OP_NO_SSLv2) | ssl.OP_NO_TLSv1
-            self.assertEqual(ssl.OP_ALL | ssl.OP_NO_TLSv1 | ssl.OP_NO_SSLv3,
+            self.assertEqual(ssl.OP_ALL | ssl.OP_NO_TLSv1 | ssl.OP_NO_SSLv3 | ssl.OP_NO_COMPRESSION,
                              ctx.options)
             ctx.options = 0
             self.assertEqual(0, ctx.options)
Index: gevent-1.4.0/src/gevent/tests/test__util.py
===================================================================
--- gevent-1.4.0.orig/src/gevent/tests/test__util.py
+++ gevent-1.4.0/src/gevent/tests/test__util.py
@@ -134,7 +134,7 @@ class TestTree(greentest.TestCase):
 
     def _normalize_tree_format(self, value):
         import re
-        hexobj = re.compile('0x[0123456789abcdef]+L?', re.I)
+        hexobj = re.compile('-?0x[0123456789abcdef]+L?', re.I)
         value = hexobj.sub('X', value)
         value = value.replace('epoll', 'select')
         value = value.replace('select', 'default')
openSUSE Build Service is sponsored by