@ -388,7 +388,7 @@ class VerseDirective(Directive):
def __init__(self, keyword, argument=None):
if keyword not in VERSE_DIRECTIVES:
#TODO Raise better exception
raise Exception
raise Exception(keyword)
super().__init__(keyword, argument)
@property
@ -262,6 +262,7 @@ class ChordproParser(Parser):
keyword = symbols[3]
argument = symbols[4]
if keyword != "newline":
symbols[0] = ast.VerseDirective(keyword, argument)
@staticmethod
@ -70,10 +70,8 @@ class TestConvert(unittest.TestCase, metaclass=dynamic.DynamicTest):
with logging_reduced():
if os.path.exists(destname):
os.remove(destname)
self.assertEqual(
self._system(main, args + [in_format, out_format, sourcename]),
1,
)
with self.assertRaises(Exception):
self._system(main, args + [in_format, out_format, sourcename])
@contextlib.contextmanager
@ -38,4 +38,4 @@ New lines can also
Be surrounded by spaces
New lines cannot
New lines cannot appear in the middle of a line
@ -38,6 +38,6 @@ Be in bridges
</p>
<p class="verse">New lines cannot
<p class="verse">New lines cannot appear in the middle of a line
</div>
@ -55,7 +55,7 @@
\begin{verse}
\end{verse}
\endsong