Skip to content

Commit 489a90b

Browse files
author
Jason Ward
committed
refs #54: used raises instead
1 parent 36b7d04 commit 489a90b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pydocx/tests/test_docx.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from tempfile import NamedTemporaryFile
44

55
from nose.plugins.skip import SkipTest
6+
from nose.tools import raises
67

78
from pydocx.tests import assert_html_equal, BASE_HTML
89
from pydocx.parsers.Docx2Html import Docx2Html
@@ -750,13 +751,10 @@ def test_missing_numbering():
750751
''')
751752

752753

754+
@raises(MalformedDocxException)
753755
def test_malformed_docx_exception():
754756
with NamedTemporaryFile(suffix='.docx') as f:
755-
try:
756-
convert(f.name)
757-
raise AssertionError('MalformedDocxException was not raised')
758-
except MalformedDocxException:
759-
pass
757+
convert(f.name)
760758

761759

762760
def _converter(*args, **kwargs):

0 commit comments

Comments
 (0)