From 749da3b67c76ca7172eef88b2624b46cb99510a9 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sun, 10 May 2015 09:58:29 -0500 Subject: repr tests are the worst. frozenset has diff repr on py3 --- tests/test_x509_ext.py | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) (limited to 'tests/test_x509_ext.py') diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py index 58fb3c46..06a68600 100644 --- a/tests/test_x509_ext.py +++ b/tests/test_x509_ext.py @@ -1453,14 +1453,24 @@ class TestDistributionPoint(object): ) ], ) - assert repr(dp) == ( - ", val" - "ue='myCN')>])>, reasons=frozenset([]), crl_issuer=[, v" - "alue='Important CA')>])>)>])>" - ) + if six.PY3: + assert repr(dp) == ( + ", value='myCN')>])>, reasons=frozenset({}), crl_issuer=[, value='Important CA')>])>)>])>" + ) + else: + assert repr(dp) == ( + ", value='myCN')>])>, reasons=frozenset([]), crl_issuer=[, value='Important CA')>])>)>])>" + ) class TestCRLDistributionPoints(object): @@ -1514,12 +1524,20 @@ class TestCRLDistributionPoints(object): None ), ]) - assert repr(cdp) == ( - "], relative_name=None, reason" - "s=frozenset([]), crl" - "_issuer=None)>])>" - ) + if six.PY3: + assert repr(cdp) == ( + "], relative_name=No" + "ne, reasons=frozenset({}), crl_issuer=None)>])>" + ) + else: + assert repr(cdp) == ( + "], relative_name=No" + "ne, reasons=frozenset([]), crl_issuer=None)>])>" + ) def test_eq(self): cdp = x509.CRLDistributionPoints([ -- cgit v1.2.3