File skip_flaky_test_on_s390x.patch of Package saltbundlepy-passlib

Index: passlib-1.7.4/passlib/tests/test_context.py
===================================================================
--- passlib-1.7.4.orig/passlib/tests/test_context.py
+++ passlib-1.7.4/passlib/tests/test_context.py
@@ -13,6 +13,7 @@ import datetime
 from functools import partial
 import logging; log = logging.getLogger(__name__)
 import os
+import unittest
 import warnings
 # site
 # pkg
@@ -35,6 +36,11 @@ from passlib.registry import (register_c
 #=============================================================================
 here = os.path.abspath(os.path.dirname(__file__))
 
+skip_on_s390x = unittest.skipIf(
+    hasattr(os, 'uname') and os.uname().machine == 's390x',
+    'skipped on s390x'
+)
+
 def merge_dicts(first, *args, **kwds):
     target = first.copy()
     for arg in args:
@@ -1590,6 +1596,7 @@ sha512_crypt__min_rounds = 45000
         self.assertEqual(ctx.using(harden_verify="true").harden_verify, None)
         self.assertEqual(ctx.using(harden_verify="false").harden_verify, None)
 
+    @skip_on_s390x
     def test_dummy_verify(self):
         """
         dummy_verify() method
Index: passlib-1.7.4/passlib/tests/test_totp.py
===================================================================
--- passlib-1.7.4.orig/passlib/tests/test_totp.py
+++ passlib-1.7.4/passlib/tests/test_totp.py
@@ -5,9 +5,11 @@
 # core
 import datetime
 from functools import partial
+import os
 import logging; log = logging.getLogger(__name__)
 import sys
 import time as _time
+import unittest
 # site
 # pkg
 from passlib import exc
@@ -53,6 +55,11 @@ KEY4_RAW = b'Hello!\xde\xad\xbe\xef'
 assert sys.float_info.radix == 2, "unexpected float_info.radix"
 assert sys.float_info.mant_dig >= 44, "double precision unexpectedly small"
 
+skip_on_s390x = unittest.skipIf(
+    hasattr(os, 'uname') and os.uname().machine == 's390x',
+    'skipped on s390x'
+)
+
 def _get_max_time_t():
     """
     helper to calc max_time_t constant (see below)
@@ -359,6 +366,7 @@ class AppWalletTest(TestCase):
         # XXX: might want to allow this, but documenting behavior for now
         self.assertRaises(ValueError, wallet.encrypt_key, b"")
 
+    @skip_on_s390x
     def test_encrypt_cost_timing(self):
         """verify cost parameter via timing"""
         self.require_aes_support()
openSUSE Build Service is sponsored by