Skip to content

Commit e750964

Browse files
tests/test_general.py: minor improvements to test_open_exceptions().
1 parent d40a4ab commit e750964

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_general.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,21 +137,29 @@ def test_open_exceptions():
137137
doc = pymupdf.open(filename, filetype="xps")
138138
except RuntimeError as e:
139139
assert repr(e).startswith("FileDataError")
140+
else:
141+
assert 0
140142

141143
try:
142144
doc = pymupdf.open(filename, filetype="xxx")
143145
except Exception as e:
144146
assert repr(e).startswith("ValueError")
147+
else:
148+
assert 0
145149

146150
try:
147151
doc = pymupdf.open("x.y")
148152
except Exception as e:
149153
assert repr(e).startswith("FileNotFoundError")
154+
else:
155+
assert 0
150156

151157
try:
152158
doc = pymupdf.open("pdf", b"")
153159
except RuntimeError as e:
154160
assert repr(e).startswith("EmptyFileError")
161+
else:
162+
assert 0
155163

156164

157165
def test_bug1945():

0 commit comments

Comments
 (0)