Skip to content

Commit af0fdcb

Browse files
committed
fix zero-division tests
1 parent 77ae662 commit af0fdcb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/snippets/division_by_zero.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,33 @@
22
5 / 0
33
except ZeroDivisionError:
44
pass
5-
except:
5+
else:
66
assert False, 'Expected ZeroDivisionError'
77

88
try:
99
5 / -0.0
1010
except ZeroDivisionError:
1111
pass
12-
except:
12+
else:
1313
assert False, 'Expected ZeroDivisionError'
1414

1515
try:
16-
5 / (3-2)
16+
5 / (2-2)
1717
except ZeroDivisionError:
1818
pass
19-
except:
19+
else:
2020
assert False, 'Expected ZeroDivisionError'
2121

2222
try:
2323
5 % 0
2424
except ZeroDivisionError:
2525
pass
26-
except:
26+
else:
2727
assert False, 'Expected ZeroDivisionError'
2828

2929
try:
3030
raise ZeroDivisionError('Is an ArithmeticError subclass?')
3131
except ArithmeticError:
3232
pass
33-
except:
34-
assert False, 'Expected ZeroDivisionError to be a subclass of ArithmeticError'
33+
else:
34+
assert False, 'Expected ZeroDivisionError'

0 commit comments

Comments
 (0)