[test] Quand il y a une erreur sur psycopg, on saute tous les adhérents

This commit is contained in:
Valentin Samir 2013-05-14 18:14:23 +02:00
parent 2c01f13776
commit e20ede8edb

View file

@ -1,5 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import psycopg2
import traceback
import random
import string
@ -57,6 +58,11 @@ def test_list_of_dict(keys, list):
ok = True
for item in list:
try: item.get(key, [])
except psycopg2.OperationalError as error:
print ERREUR
if show_traceback: print traceback.format_exc()
else: print "\t%r" % error
return
except Exception as error:
if ok: print ERREUR
if show_traceback: print traceback.format_exc()