Use context manager to avoid error in test.
Use context manager in tests to avoid an error during the Build in Debian. Forwarded: https://github.com/python-xlib/python-xlib/issues/231 Bug-Debian: https://bugs.debian.org/1006033 Gbp-Pq: Name 0004-Use-context-manager-to-avoid-error-in-test.patch
This commit is contained in:
parent
193704df97
commit
01df945e02
|
@ -52,8 +52,9 @@ class TestXlibDisplay(unittest.TestCase):
|
|||
self.assertEqual(str(self.display.display.socket_error), "Display connection closed by client")
|
||||
|
||||
def test_can_close_display_and_check_for_error(self):
|
||||
self.display.close()
|
||||
self.assertRaises(Xlib.error.ConnectionClosedError, self.display.flush)
|
||||
with self.assertRaises(Xlib.error.ConnectionClosedError):
|
||||
self.display.close()
|
||||
self.display.flush()
|
||||
|
||||
def test_return_fileno(self):
|
||||
self.assertTrue(isinstance(self.display.fileno(), int))
|
||||
|
|
Loading…
Reference in New Issue