diff --git a/tests/test_main.py b/tests/test_main.py index 6f5d5e605e7e704f9e0f5541b04c8aae70e2fe76..ef287ff1da197af11c4412c9526beab00a29b139 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -91,6 +91,13 @@ def test_fraction(): assert len(tree.warnings) == 1 assert tree.warnings == [r'The dsi string contains more than one \per, does not match specs! Given string: \metre\per\metre\per\metre'] + # empty fraction + with pytest.warns(RuntimeWarning, match=r'The dsi string contains a \\per missing a numerator or denominator! Given string: \\per\\one'): + tree = p.parse(r'\per\one') + assert tree.toLatex() == r'$$1$$' + assert not tree.valid + assert len(tree.warnings) == 1 + def test_empty(): with pytest.warns(RuntimeWarning, match='Given D-SI string is empty!'): assert p.parse('').toLatex() == ''