[test] Quand il y a une erreur sur psycopg, on saute tous les adhérents
This commit is contained in:
parent
2c01f13776
commit
e20ede8edb
1 changed files with 6 additions and 0 deletions
6
test.py
6
test.py
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
import psycopg2
|
||||||
import traceback
|
import traceback
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
|
@ -57,6 +58,11 @@ def test_list_of_dict(keys, list):
|
||||||
ok = True
|
ok = True
|
||||||
for item in list:
|
for item in list:
|
||||||
try: item.get(key, [])
|
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:
|
except Exception as error:
|
||||||
if ok: print ERREUR
|
if ok: print ERREUR
|
||||||
if show_traceback: print traceback.format_exc()
|
if show_traceback: print traceback.format_exc()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue