summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2017-07-06 23:43:47 -0400
committerPaul Kehrer <paul.l.kehrer@gmail.com>2017-07-06 22:43:47 -0500
commite466bc917e070e34208a52838a0e21730345a78f (patch)
tree94c21611c168de9cca388fe2bab6542b56c8f567
parentb3460c6a9a45a016d1ab65c149c606fa3f07096d (diff)
downloadpyopenssl-e466bc917e070e34208a52838a0e21730345a78f.tar.gz
FIxed #266 -- attempt to deflake our tests (#660)
* FIxed #266 -- attempt to deflake our tests * typo
-rw-r--r--tests/test_crypto.py7
-rw-r--r--tox.ini1
2 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_crypto.py b/tests/test_crypto.py
index 4b99bd9..04970fa 100644
--- a/tests/test_crypto.py
+++ b/tests/test_crypto.py
@@ -22,6 +22,8 @@ from cryptography.hazmat.backends.openssl.backend import backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa
+import flaky
+
from OpenSSL.crypto import TYPE_RSA, TYPE_DSA, Error, PKey, PKeyType
from OpenSSL.crypto import X509, X509Type, X509Name, X509NameType
from OpenSSL.crypto import (
@@ -1626,7 +1628,7 @@ WpOdIpB8KksUTCzV591Nr1wd
not_before = datetime.strptime(
cert.get_notBefore().decode(), "%Y%m%d%H%M%SZ"
)
- not_before_max = datetime.utcnow() + timedelta(seconds=100)
+ not_before_max = datetime.utcnow() + timedelta(seconds=101)
assert not_before_min <= not_before <= not_before_max
def test_gmtime_adj_notAfter_wrong_args(self):
@@ -3215,6 +3217,9 @@ class TestCRL(object):
b'Issuer: /C=US/ST=IL/L=Chicago/O=Testing/CN=Testing Root CA'
)
+ # Flaky because we compare the output of running commands which sometimes
+ # varies by 1 second
+ @flaky.flaky
def test_export_text(self):
"""
If passed ``FILETYPE_TEXT`` for the format, ``CRL.export`` returns a
diff --git a/tox.ini b/tox.ini
index 76e1c5b..f655009 100644
--- a/tox.ini
+++ b/tox.ini
@@ -9,6 +9,7 @@ deps =
coverage>=4.2
pytest>=3.0.1
pretend
+ flaky
cryptographyMaster: git+https://github.com/pyca/cryptography.git
cryptographyMinimum: cryptography<=1.9
setenv =