diff --git a/pylink/jlink.py b/pylink/jlink.py index 472f88c..8ef21ba 100644 --- a/pylink/jlink.py +++ b/pylink/jlink.py @@ -731,7 +731,7 @@ def open(self, serial_no=None, ip_addr=None): # preserved here to simplify workflows using one emulator: result = self._dll.JLINKARM_SelectUSB(0) if result != 0: - raise errors.JlinkException('Could not connect to default emulator.') + raise errors.JLinkException('Could not connect to default emulator.') # Acquire the lock for the J-Link being opened only if the serial # number was passed in, otherwise skip it here. Note that the lock diff --git a/tests/unit/test_jlink.py b/tests/unit/test_jlink.py index 7220d65..53e311a 100644 --- a/tests/unit/test_jlink.py +++ b/tests/unit/test_jlink.py @@ -570,7 +570,7 @@ def test_jlink_open_unspecified(self): Returns: ``None`` """ - with self.assertRaises(AttributeError): + with self.assertRaises(JLinkException): self.jlink.open() def test_jlink_open_unspecified_context_manager(self): @@ -587,7 +587,7 @@ def test_jlink_open_unspecified_context_manager(self): Returns: ``None`` """ - with self.assertRaises(AttributeError): + with self.assertRaises(JLinkException): with jlink.JLink(self.lib) as jl: self.assertTrue(jl.opened()) # Opened in CM. self.dll.JLINKARM_Close.assert_called() # Closed on exit.