URL: https://github.com/freeipa/freeipa/pull/178
Author: apophys
 Title: #178: ipatests: Fix assert_deepequal outside of pytest process
Action: opened

PR body:
"""
https://fedorahosted.org/freeipa/ticket/6420
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/178/head:pr178
git checkout pr178
From 9ea5c11a90bdf9d41b874b34904afaa567cecf74 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Milan=20Kub=C3=ADk?= <mku...@redhat.com>
Date: Fri, 21 Oct 2016 14:29:50 +0200
Subject: [PATCH] ipatests: Fix assert_deepequal outside of pytest process

https://fedorahosted.org/freeipa/ticket/6420
---
 ipatests/util.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ipatests/util.py b/ipatests/util.py
index 889e850..bca8e9c 100644
--- a/ipatests/util.py
+++ b/ipatests/util.py
@@ -330,7 +330,12 @@ def assert_deepequal(expected, got, doc='', stack=tuple()):
     Note that lists and tuples are considered equivalent, and the order of
     their elements does not matter.
     """
-    if pytest.config.getoption("pretty_print"):  # pylint: disable=no-member
+    try:
+        pretty_print = pytest.config.getoption("pretty_print")  # pylint: disable=no-member
+    except AttributeError:
+        pretty_print = False
+
+    if pretty_print:
         expected_str = struct_to_string(expected, EXPECTED_LEN)
         got_str = struct_to_string(got, GOT_LEN)
     else:
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to