tests: Add test for exception matching of a tuple of exceptions.

pull/875/head
Damien George 2014-09-24 14:14:38 +01:00
rodzic 4bcd04bcad
commit 2234c3f23d
1 zmienionych plików z 21 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,21 @@
# test exception matching against a tuple
try:
fail
except (Exception,):
print('except 1')
try:
fail
except (Exception, Exception):
print('except 2')
try:
fail
except (TypeError, NameError):
print('except 3')
try:
fail
except (TypeError, ValueError, Exception):
print('except 4')