diff --git a/pymatbridge/tests/test_magic.py b/pymatbridge/tests/test_magic.py index 4a9d38f..bc6db62 100644 --- a/pymatbridge/tests/test_magic.py +++ b/pymatbridge/tests/test_magic.py @@ -106,5 +106,10 @@ def test_struct(self): npt.assert_equal(self.ip.user_ns['obj']['str'], self.ip.user_ns['str']) def test_faulty(self): + # Test that an error is raised for wrong matlab code: npt.assert_raises(MatlabInterperterError, lambda: self.ip.run_line_magic('matlab', '1 = 2')) + + # Test that an error is raised for non-existent inputs + npt.assert_raises(MatlabInterperterError, + lambda: self.ip.run_cell_magic('matlab', '-i no_such_thing -o out_array', 'a = 1;'))