Skip to content

Commit c199efa

Browse files
author
Xin Dong
committed
Only print out the error in verbose mode
1 parent 0ece69e commit c199efa

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/correctness/document-correctness.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,18 +310,22 @@ def _run_operation_(op1, op2):
310310
try:
311311
func1(*args1, **kwargs1)
312312
except pymongo.errors.OperationFailure as e:
313-
print "Failed func1 with " + str(e)
313+
if verbose:
314+
print "Failed func1 with " + str(e)
314315
exceptionOne = e
315316
except MongoModelException as e:
316-
print "Failed func1 with " + str(e)
317+
if verbose:
318+
print "Failed func1 with " + str(e)
317319
exceptionOne = e
318320
try:
319321
func2(*args2, **kwargs2)
320322
except pymongo.errors.OperationFailure as e:
321-
print "Failed func2 with " + str(e)
323+
if verbose:
324+
print "Failed func2 with " + str(e)
322325
exceptionTwo = e
323326
except MongoModelException as e:
324-
print "Failed func2 with " + str(e)
327+
if verbose:
328+
print "Failed func2 with " + str(e)
325329
exceptionTwo = e
326330

327331
if ((exceptionOne is None and exceptionTwo is None)

0 commit comments

Comments
 (0)