From e466bc917e070e34208a52838a0e21730345a78f Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Thu, 6 Jul 2017 23:43:47 -0400 Subject: FIxed #266 -- attempt to deflake our tests (#660) * FIxed #266 -- attempt to deflake our tests * typo --- tests/test_crypto.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests') 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 -- cgit v1.2.1